diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-27 10:59:26 -0700 |
commit | a026bde1ac84f90f0b82faa18890b2023c5198d5 (patch) | |
tree | 8e976b861d4b23904c09bb1fbdd8004f37cb6e6f /builtin/rev-parse.c | |
parent | 09fb53568e3e00e30891b118045aa07ede524103 (diff) | |
parent | 3b754eedd58636926d07b14a34799a3aa7b8ebc2 (diff) | |
download | git-a026bde1ac84f90f0b82faa18890b2023c5198d5.tar.gz |
Merge branch 'jk/prefix-filename'
Code clean-up with minor bugfixes.
* jk/prefix-filename:
bundle: use prefix_filename with bundle path
prefix_filename: simplify windows #ifdef
prefix_filename: return newly allocated string
prefix_filename: drop length parameter
prefix_filename: move docstring to header file
hash-object: fix buffer reuse with --path in a subdirectory
Diffstat (limited to 'builtin/rev-parse.c')
-rw-r--r-- | builtin/rev-parse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 1e5bdea0d5..9e53a1a7ca 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -228,9 +228,9 @@ static int show_file(const char *arg, int output_prefix) if ((filter & (DO_NONFLAGS|DO_NOREV)) == (DO_NONFLAGS|DO_NOREV)) { if (output_prefix) { const char *prefix = startup_info->prefix; - show(prefix_filename(prefix, - prefix ? strlen(prefix) : 0, - arg)); + char *fname = prefix_filename(prefix, arg); + show(fname); + free(fname); } else show(arg); return 1; |