summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-12-20 07:27:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-12-21 20:03:03 (GMT)
commit3e4068ed90fd3c6f24303560113aae6dbb758699 (patch)
tree961357513efbe7e6985801d5d024c39e17b03d0e /t
parenta2558fb8e1e387b630312311e1d22c95663da5d0 (diff)
downloadgit-3e4068ed90fd3c6f24303560113aae6dbb758699.zip
git-3e4068ed90fd3c6f24303560113aae6dbb758699.tar.gz
git-3e4068ed90fd3c6f24303560113aae6dbb758699.tar.bz2
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 't')
-rwxr-xr-xt/t1401-symbolic-ref.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index 36378b0..e9219a9 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -63,4 +63,10 @@ test_expect_success 'symbolic-ref fails to delete real ref' '
'
reset_to_sane
+test_expect_success 'symbolic-ref reports failure in exit code' '
+ test_when_finished "rm -f .git/HEAD.lock" &&
+ >.git/HEAD.lock &&
+ test_must_fail git symbolic-ref HEAD refs/heads/whatever
+'
+
test_done