[PATCH 3/4] cat-file: restore ambiguity warning flag in batch_objects
- From
Jeff King <peff@peff.net>
- Date
- Jan 7, 2014, 22:10 UTC
- Message-ID
- <20140107221051.GC10161@sigill.intra.peff.net>
- In-Reply-To
- <20140107220856.GA10074@sigill.intra.peff.net>
Since commit 25fba78, we turn off the object/refname ambiguity warning using a global flag. However, we never restore it. This doesn't really matter in the current code, since the program generally exits immediately after the function is done, but it's good code hygeine to clean up after ourselves.
Signed-off-by: Jeff King <peff@peff.net> --- builtin/cat-file.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index ce79103..c64e287 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -264,6 +264,7 @@ static int batch_objects(struct batch_options *opt) struct strbuf buf = STRBUF_INIT; struct expand_data data; int retval = 0; + int save_warning = warn_on_object_refname_ambiguity; if (!opt->format) opt->format = "%(objectname) %(objecttype) %(objectsize)"; @@ -314,6 +315,7 @@ static int batch_objects(struct batch_options *opt) break; } + warn_on_object_refname_ambiguity = save_warning; strbuf_release(&buf); return retval; }
-- 1.8.5.2.500.g8060133