rev-parse --glob
[git/git.git] / builtin-rev-parse.c
index 37d0233..a635dde 100644 (file)
@@ -52,6 +52,7 @@ static int is_rev_argument(const char *arg)
                "--parents",
                "--pretty",
                "--remotes",
                "--parents",
                "--pretty",
                "--remotes",
+               "--glob=",
                "--sparse",
                "--tags",
                "--topo-order",
                "--sparse",
                "--tags",
                "--topo-order",
@@ -577,6 +578,10 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
                                for_each_tag_ref(show_reference, NULL);
                                continue;
                        }
                                for_each_tag_ref(show_reference, NULL);
                                continue;
                        }
+                       if (!prefixcmp(arg, "--glob=")) {
+                               for_each_glob_ref(show_reference, arg + 7, NULL);
+                               continue;
+                       }
                        if (!strcmp(arg, "--remotes")) {
                                for_each_remote_ref(show_reference, NULL);
                                continue;
                        if (!strcmp(arg, "--remotes")) {
                                for_each_remote_ref(show_reference, NULL);
                                continue;