bisect: simplify the addition of new bisect terms
[gitweb.git] / builtin / rev-parse.c
index 3626c61da67abbe418e492c7828f6e153f6055d8..b6232390a649a74f9c188a6f9abe8ab9651191a1 100644 (file)
@@ -190,17 +190,17 @@ static int show_default(void)
        return 0;
 }
 
-static int show_reference(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
+static int show_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
 {
        if (ref_excluded(ref_excludes, refname))
                return 0;
-       show_rev(NORMAL, sha1, refname);
+       show_rev(NORMAL, oid->hash, refname);
        return 0;
 }
 
-static int anti_reference(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
+static int anti_reference(const char *refname, const struct object_id *oid, int flag, void *cb_data)
 {
-       show_rev(REVERSED, sha1, refname);
+       show_rev(REVERSED, oid->hash, refname);
        return 0;
 }
 
@@ -533,6 +533,13 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
        for (i = 1; i < argc; i++) {
                const char *arg = argv[i];
 
+               if (!strcmp(arg, "--git-path")) {
+                       if (!argv[i + 1])
+                               die("--git-path requires an argument");
+                       puts(git_path("%s", argv[i + 1]));
+                       i++;
+                       continue;
+               }
                if (as_is) {
                        if (show_file(arg, output_prefix) && as_is < 2)
                                verify_filename(prefix, arg, 0);
@@ -755,6 +762,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                                free(cwd);
                                continue;
                        }
+                       if (!strcmp(arg, "--git-common-dir")) {
+                               puts(get_git_common_dir());
+                               continue;
+                       }
                        if (!strcmp(arg, "--resolve-git-dir")) {
                                const char *gitdir = argv[++i];
                                if (!gitdir)