diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-03-20 01:03:12 +0300 |
commit | 95de3763498a5a092a454bb548d40e918c2870c1 (patch) | |
tree | ed82119d97b88465de12360cc27db9933b04df4e /builtin/checkout.c | |
parent | 12201fd756bad12c137343d5fd65200f4d0f192d (diff) | |
parent | 0bbe10313e0b61812082d47431e8648f9df48f15 (diff) |
Merge branch 'jk/bundle-use-dash-for-stdfiles'
"git bundle" learned that "-" is a common way to say that the input
comes from the standard input and/or the output goes to the
standard output. It used to work only for output and only from the
root level of the working tree.
* jk/bundle-use-dash-for-stdfiles:
parse-options: use prefix_filename_except_for_dash() helper
parse-options: consistently allocate memory in fix_filename()
bundle: don't blindly apply prefix_filename() to "-"
bundle: document handling of "-" as stdin
bundle: let "-" mean stdin for reading operations
Diffstat (limited to 'builtin/checkout.c')
-rw-r--r-- | builtin/checkout.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c index 2b3ae6032d..734d730980 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -76,7 +76,7 @@ struct checkout_opts { const char *ignore_unmerged_opt; int ignore_unmerged; int pathspec_file_nul; - const char *pathspec_from_file; + char *pathspec_from_file; const char *new_branch; const char *new_branch_force; @@ -1890,6 +1890,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix) options, checkout_usage, &new_branch_info); branch_info_release(&new_branch_info); clear_pathspec(&opts.pathspec); + free(opts.pathspec_from_file); FREE_AND_NULL(options); return ret; } |