diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/rev-parse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 7e074aad40..7a4f2c0b0c 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -763,7 +763,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) continue; } if (!strcmp(arg, "--git-common-dir")) { - puts(get_git_common_dir()); + const char *pfx = prefix ? prefix : ""; + puts(prefix_filename(pfx, strlen(pfx), get_git_common_dir())); continue; } if (!strcmp(arg, "--resolve-git-dir")) { |