diff options
author | Jeff King <peff@peff.net> | 2017-08-03 00:25:27 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-03 00:45:20 +0200 |
commit | 7ba826290aa448bb9d0d45c3bb4b34905b741013 (patch) | |
tree | e705e66e885f12b2a5adba9c01cfb03b3f8673dc /revision.c | |
parent | t6018: flesh out empty input/output rev-list tests (diff) | |
download | git-7ba826290aa448bb9d0d45c3bb4b34905b741013.tar.xz git-7ba826290aa448bb9d0d45c3bb4b34905b741013.zip |
revision: add rev_input_given flag
Normally a caller that invokes setup_revisions() has to
check rev.pending to see if anything was actually queued for
the traversal. But they can't tell the difference between
two cases:
1. The user gave us no tip from which to start a
traversal.
2. The user tried to give us tips via --glob, --all, etc,
but their patterns ended up being empty.
Let's set a flag in the rev_info struct that callers can use
to tell the difference. We can set this from the
init_all_refs_cb() function. That's a little funny because
it's not exactly about initializing the "cb" struct itself.
But that function is the common setup place for doing
pattern traversals that is used by --glob, --all, etc.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 6603af9444..08d5806b8a 100644 --- a/revision.c +++ b/revision.c @@ -1168,6 +1168,7 @@ static void init_all_refs_cb(struct all_refs_cb *cb, struct rev_info *revs, { cb->all_revs = revs; cb->all_flags = flags; + revs->rev_input_given = 1; } void clear_ref_exclusion(struct string_list **ref_excludes_p) |