From 3e4068ed90fd3c6f24303560113aae6dbb758699 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 20 Dec 2015 02:27:18 -0500 Subject: 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 Signed-off-by: Junio C Hamano --- builtin/symbolic-ref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') 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); -- cgit v1.3-5-g9baa