convert.c: ident + core.autocrlf didn't work
[gitweb.git] / builtin / rev-parse.c
index bd16876df5ff7bce4fbf348d84a0ebc4ea53e7d7..cf8487b3b95fcca9a8a96a1562646ee8ddd5b354 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")) {