summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-02-22 11:23:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-22 18:23:45 (GMT)
commitb81842cbbba21a400c9c7a78c5b358565936254a (patch)
tree063509f29a617d1e63263c04fa9f8b6461e1f7c2 /t
parent27852b2c5347ecd815301e668e7415509f1dae07 (diff)
downloadgit-b81842cbbba21a400c9c7a78c5b358565936254a.zip
git-b81842cbbba21a400c9c7a78c5b358565936254a.tar.gz
git-b81842cbbba21a400c9c7a78c5b358565936254a.tar.bz2
branch: die on config error when unsetting upstream
When we try to unset upstream configurations we do not check return codes for the `git_config_set` functions. As those may indicate that we were unable to unset the respective configuration we may exit successfully without any error message while in fact the upstream configuration was not unset. Fix this by dying with an error message when we cannot unset the configuration. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3200-branch.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index dd776b3..a897248 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -473,6 +473,13 @@ test_expect_success '--unset-upstream should fail if given a non-existent branch
test_must_fail git branch --unset-upstream i-dont-exist
'
+test_expect_success '--unset-upstream should fail if config is locked' '
+ test_when_finished "rm -f .git/config.lock" &&
+ git branch --set-upstream-to locked &&
+ >.git/config.lock &&
+ test_must_fail git branch --unset-upstream
+'
+
test_expect_success 'test --unset-upstream on HEAD' '
git branch my14 &&
test_config branch.master.remote foo &&