summaryrefslogtreecommitdiff
path: root/builtin-update-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-update-ref.c')
-rw-r--r--builtin-update-ref.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin-update-ref.c b/builtin-update-ref.c
index 1461937cb9..5ee960bf41 100644
--- a/builtin-update-ref.c
+++ b/builtin-update-ref.c
@@ -61,10 +61,8 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
lock = lock_any_ref_for_update(refname, oldval ? oldsha1 : NULL);
if (!lock)
- return 1;
+ die("%s: cannot lock the ref", refname);
if (write_ref_sha1(lock, sha1, msg) < 0)
- return 1;
-
- /* write_ref_sha1 always unlocks the ref, no need to do it explicitly */
+ die("%s: cannot update the ref", refname);
return 0;
}