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/reset.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/reset.c')
-rw-r--r-- | builtin/reset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index 58f567afd3..24b04aeecb 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -318,7 +318,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix) int reset_type = NONE, update_ref_status = 0, quiet = 0; int no_refresh = 0; int patch_mode = 0, pathspec_file_nul = 0, unborn; - const char *rev, *pathspec_from_file = NULL; + const char *rev; + char *pathspec_from_file = NULL; struct object_id oid; struct pathspec pathspec; int intent_to_add = 0; @@ -496,5 +497,6 @@ int cmd_reset(int argc, const char **argv, const char *prefix) cleanup: clear_pathspec(&pathspec); + free(pathspec_from_file); return update_ref_status; } |