summaryrefslogtreecommitdiff
path: root/builtin/symbolic-ref.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-12-20 02:27:18 -0500
committerJunio C Hamano <gitster@pobox.com>2015-12-21 12:03:03 -0800
commit3e4068ed90fd3c6f24303560113aae6dbb758699 (patch)
tree961357513efbe7e6985801d5d024c39e17b03d0e /builtin/symbolic-ref.c
parenta2558fb8e1e387b630312311e1d22c95663da5d0 (diff)
downloadgit-3e4068ed90fd3c6f24303560113aae6dbb758699.tar.gz
symbolic-ref: propagate error code from create_symref()
If create_symref() fails, git-symbolic-ref will still exit with code 0, and our caller has no idea that the command did nothing. This appears to have been broken since the beginning of time (e.g., it is not a regression where create_symref() stopped calling die() or something similar). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/symbolic-ref.c')
-rw-r--r--builtin/symbolic-ref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index ce0fde705c..9c29a64e43 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -67,7 +67,7 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
if (!strcmp(argv[0], "HEAD") &&
!starts_with(argv[1], "refs/"))
die("Refusing to point HEAD outside of refs/");
- create_symref(argv[0], argv[1], msg);
+ ret = !!create_symref(argv[0], argv[1], msg);
break;
default:
usage_with_options(git_symbolic_ref_usage, options);