remote rm/prune: print a message when writing packed-refs fails
commit2ebb49ca8ac34afb0ffe00e4bceac73e8c825ef1
authorRonnie Sahlberg <sahlberg@google.com>
Thu, 11 Sep 2014 15:42:57 +0000 (11 08:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2014 17:47:26 +0000 (15 10:47 -0700)
tree6d08ad37be2ac2cc2b2bedbc558a7e5a510defcc
parent971c41c71728d057115b105f427202f98565f933
remote rm/prune: print a message when writing packed-refs fails

Until v2.1.0-rc0~22^2~11 (refs.c: add an err argument to
repack_without_refs, 2014-06-20), repack_without_refs forgot to
provide an error message when commit_packed_refs fails.  Even today,
it only provides a message for callers that pass a non-NULL err
parameter.  Internal callers in refs.c pass non-NULL err but
"git remote" does not.

That means that "git remote rm" and "git remote prune" can fail
without printing a message about why.  Fix them by passing in a
non-NULL err parameter and printing the returned message.

This is the last caller to a ref handling function passing err ==
NULL.  A later patch can drop support for err == NULL, avoiding such
problems in the future.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
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/remote.c