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

@ -610,6 +610,9 @@ char *prefix_path_gently(const char *prefix, int len, int *remaining, const char
*/
char *prefix_filename(const char *prefix, const char *path);
/* Likewise, but path=="-" always yields "-" */
char *prefix_filename_except_for_dash(const char *prefix, const char *path);
int check_filename(const char *prefix, const char *name);
void verify_filename(const char *prefix,
const char *name,