Merge branch 'jc/apply-blank-at-eof-fix'
[gitweb.git] / builtin / rev-parse.c
index a5a1c86e92720e8beefd8275acfc5df2dbdce175..98d1cbeccacc4b22dee88dab3d0154a3f70afe81 100644 (file)
@@ -44,10 +44,15 @@ static int is_rev_argument(const char *arg)
                "--branches=",
                "--branches",
                "--header",
+               "--ignore-missing",
                "--max-age=",
                "--max-count=",
                "--min-age=",
                "--no-merges",
+               "--min-parents=",
+               "--no-min-parents",
+               "--max-parents=",
+               "--no-max-parents",
                "--objects",
                "--objects-edge",
                "--parents",
@@ -463,6 +468,14 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                return 0;
        }
 
+       if (argc > 2 && !strcmp(argv[1], "--resolve-git-dir")) {
+               const char *gitdir = resolve_gitdir(argv[2]);
+               if (!gitdir)
+                       die("not a gitdir '%s'", argv[2]);
+               puts(gitdir);
+               return 0;
+       }
+
        if (argc > 1 && !strcmp("-h", argv[1]))
                usage(builtin_rev_parse_usage);