update-ref --stdin: narrow scope of err strbuf
commitab5ac95725f7a4f36f72be48f340a84e46996e90
authorJonathan Nieder <jrnieder@gmail.com>
Tue, 2 Sep 2014 21:10:52 +0000 (2 14:10 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Sep 2014 17:04:19 +0000 (3 10:04 -0700)
treea3496136ea02fecc20b771a7128dfb8845861ee8
parent7521cc4611a783f4a8174bd0fcec5f4a47357ac1
update-ref --stdin: narrow scope of err strbuf

Making the strbuf local in each function that needs to print errors
saves the reader from having to think about action at a distance,
such as

 * errors piling up and being concatenated with no newline between
   them
 * errors unhandled in one function, to be later handled in another
 * concurrency issues, if this code starts using threads some day

No functional change intended.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/update-ref.c