From 5398f0ee6bab039701912fdaf784792f4cf76afe Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Tue, 18 Jul 2006 14:52:15 +0200 Subject: [PATCH] update-ref: print errors otherwise it not clear what happened Signed-off-by: Alex Riesen --- builtin-update-ref.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/builtin-update-ref.c b/builtin-update-ref.c index 83094ab..ad4a44d 100644 --- a/builtin-update-ref.c +++ b/builtin-update-ref.c @@ -50,10 +50,14 @@ int cmd_update_ref(int argc, const char die("%s: not a valid old SHA1", oldval); lock = lock_any_ref_for_update(refname, oldval ? oldsha1 : NULL, 0); - if (!lock) + if (!lock) { + error("%s: %s", refname, strerror(errno)); return 1; - if (write_ref_sha1(lock, sha1, msg) < 0) + } + if (write_ref_sha1(lock, sha1, msg) < 0) { + error("%s: %s", refname, strerror(errno)); return 1; + } /* write_ref_sha1 always unlocks the ref, no need to do it explicitly */ return 0; -- 1.4.2.rc1.g22734