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
This commit is contained in:
Junio C Hamano
2023-03-19 15:03:12 -07:00
11 changed files with 82 additions and 19 deletions

View File

@ -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;
}