revision: add rev_input_given flag
commit7ba826290aa448bb9d0d45c3bb4b34905b741013
authorJeff King <peff@peff.net>
Wed, 2 Aug 2017 22:25:27 +0000 (2 18:25 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Aug 2017 22:45:20 +0000 (2 15:45 -0700)
treee705e66e885f12b2a5adba9c01cfb03b3f8673dc
parent0c5dc7431a01d325e815ce722d80ad549a41e632
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>
revision.c
revision.h