Skip to content

Commit

Permalink
Inline parseBooleanPullOption into its only caller
Browse files Browse the repository at this point in the history
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Dec 12, 2024
1 parent 3bc558c commit 856136d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions pkg/chunked/storage_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ func parsePullOptions(store storage.Store) pullOptions {
{&res.convertImages, "convert_images", false},
{&res.useHardLinks, "use_hard_links", false},
} {
*e.dest = parseBooleanPullOption(options, e.name, e.defaultValue)
if value, ok := options[e.name]; ok {
*e.dest = strings.ToLower(value) == "true"
} else {
*e.dest = e.defaultValue
}
}
res.ostreeRepos = strings.Split(options["ostree_repos"], ":")

Expand Down Expand Up @@ -1072,13 +1076,6 @@ type hardLinkToCreate struct {
metadata *fileMetadata
}

func parseBooleanPullOption(pullOptions map[string]string, name string, def bool) bool {
if value, ok := pullOptions[name]; ok {
return strings.ToLower(value) == "true"
}
return def
}

type findAndCopyFileOptions struct {
useHardLinks bool
ostreeRepos []string
Expand Down

0 comments on commit 856136d

Please sign in to comment.