summaryrefslogtreecommitdiff
path: root/builtin-rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-23 20:05:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-23 20:05:18 (GMT)
commit80eac928ae11d4e417feddcc6a1ec373cf41e14f (patch)
treedcd3c45289ecc0f3788eac42ff065bfc466fa080 /builtin-rev-parse.c
parente73bbd96c6e9ce11a101dac03402d0f718a1bd23 (diff)
parente2b53e58081e6a30309625fc6194ccb42772846b (diff)
downloadgit-80eac928ae11d4e417feddcc6a1ec373cf41e14f.zip
git-80eac928ae11d4e417feddcc6a1ec373cf41e14f.tar.gz
git-80eac928ae11d4e417feddcc6a1ec373cf41e14f.tar.bz2
Merge branch 'il/rev-glob'
Diffstat (limited to 'builtin-rev-parse.c')
-rw-r--r--builtin-rev-parse.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index cbe5b42..a8c5043 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -41,6 +41,7 @@ static int is_rev_argument(const char *arg)
"--all",
"--bisect",
"--dense",
+ "--branches=",
"--branches",
"--header",
"--max-age=",
@@ -51,8 +52,11 @@ static int is_rev_argument(const char *arg)
"--objects-edge",
"--parents",
"--pretty",
+ "--remotes=",
"--remotes",
+ "--glob=",
"--sparse",
+ "--tags=",
"--tags",
"--topo-order",
"--date-order",
@@ -569,14 +573,33 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
for_each_ref_in("refs/bisect/good", anti_reference, NULL);
continue;
}
+ if (!prefixcmp(arg, "--branches=")) {
+ for_each_glob_ref_in(show_reference, arg + 11,
+ "refs/heads/", NULL);
+ continue;
+ }
if (!strcmp(arg, "--branches")) {
for_each_branch_ref(show_reference, NULL);
continue;
}
+ if (!prefixcmp(arg, "--tags=")) {
+ for_each_glob_ref_in(show_reference, arg + 7,
+ "refs/tags/", NULL);
+ continue;
+ }
if (!strcmp(arg, "--tags")) {
for_each_tag_ref(show_reference, NULL);
continue;
}
+ if (!prefixcmp(arg, "--glob=")) {
+ for_each_glob_ref(show_reference, arg + 7, NULL);
+ continue;
+ }
+ if (!prefixcmp(arg, "--remotes=")) {
+ for_each_glob_ref_in(show_reference, arg + 10,
+ "refs/remotes/", NULL);
+ continue;
+ }
if (!strcmp(arg, "--remotes")) {
for_each_remote_ref(show_reference, NULL);
continue;