Git 2.7.6
[gitweb.git] / builtin / rev-parse.c
index 7e074aad408ee7d63d86643878ff5c5bb311f732..7a4f2c0b0ccedf958b78b2bdda217bfb269c6b23 100644 (file)
@@ -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")) {