Skip to content

Commit

Permalink
log: parse separate option for --glob
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Matthieu Moy authored and Junio C Hamano committed Aug 6, 2010
1 parent 7d7b86f commit 5adba90
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 5 additions & 2 deletions revision.c
Original file line number Diff line number Diff line change
@@ -1484,6 +1484,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
{
int i, flags, left, seen_dashdash, read_from_stdin, got_rev_arg = 0;
const char **prune_data = NULL;
const char *optarg;
int argcount;

/* First, search for "--" */
seen_dashdash = 0;
@@ -1530,10 +1532,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
handle_refs(revs, flags, for_each_remote_ref);
continue;
}
if (!prefixcmp(arg, "--glob=")) {
if ((argcount = parse_long_opt("glob", argv + i, &optarg))) {
struct all_refs_cb cb;
i += argcount - 1;
init_all_refs_cb(&cb, revs, flags);
for_each_glob_ref(handle_one_ref, arg + 7, &cb);
for_each_glob_ref(handle_one_ref, optarg, &cb);
continue;
}
if (!prefixcmp(arg, "--branches=")) {
6 changes: 6 additions & 0 deletions t/t6018-rev-list-glob.sh
Original file line number Diff line number Diff line change
@@ -123,6 +123,12 @@ test_expect_success 'rev-list --glob=refs/heads/subspace/*' '
'

test_expect_success 'rev-list --glob refs/heads/subspace/*' '
compare rev-list "subspace/one subspace/two" "--glob refs/heads/subspace/*"
'

test_expect_success 'rev-list --glob=heads/subspace/*' '
compare rev-list "subspace/one subspace/two" "--glob=heads/subspace/*"

0 comments on commit 5adba90

Please sign in to comment.