diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t1501-work-tree.sh (renamed from t/t1501-worktree.sh) | 0 | ||||
-rwxr-xr-x | t/t1509-root-work-tree.sh (renamed from t/t1509-root-worktree.sh) | 0 | ||||
-rwxr-xr-x | t/t3200-branch.sh | 16 | ||||
-rwxr-xr-x | t/t5505-remote.sh | 9 | ||||
-rwxr-xr-x | t/t7409-submodule-detached-work-tree.sh (renamed from t/t7409-submodule-detached-worktree.sh) | 0 |
5 files changed, 24 insertions, 1 deletions
diff --git a/t/t1501-worktree.sh b/t/t1501-work-tree.sh index cc5b870e5..cc5b870e5 100755 --- a/t/t1501-worktree.sh +++ b/t/t1501-work-tree.sh diff --git a/t/t1509-root-worktree.sh b/t/t1509-root-work-tree.sh index 553a3f601..553a3f601 100755 --- a/t/t1509-root-worktree.sh +++ b/t/t1509-root-work-tree.sh diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index cdaf6f64e..a89724849 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -446,6 +446,13 @@ test_expect_success '--set-upstream-to fails on a non-ref' ' test_must_fail git branch --set-upstream-to HEAD^{} ' +test_expect_success '--set-upstream-to fails on locked config' ' + test_when_finished "rm -f .git/config.lock" && + >.git/config.lock && + git branch locked && + test_must_fail git branch --set-upstream-to locked +' + test_expect_success 'use --set-upstream-to modify HEAD' ' test_config branch.master.remote foo && test_config branch.master.merge foo && @@ -466,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 && @@ -579,7 +593,7 @@ test_expect_success 'avoid ambiguous track' ' git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master && git config remote.ambi2.url lilili && git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master && - git branch all1 master && + test_must_fail git branch all1 master && test -z "$(git config branch.all1.merge)" ' diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index dfaf9d9f6..013e03dee 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -932,6 +932,15 @@ test_expect_success 'get-url on new remote' ' echo foo | get_url_test --push --all someremote ' +test_expect_success 'remote set-url with locked config' ' + test_when_finished "rm -f .git/config.lock" && + git config --get-all remote.someremote.url >expect && + >.git/config.lock && + test_must_fail git remote set-url someremote baz && + git config --get-all remote.someremote.url >actual && + cmp expect actual +' + test_expect_success 'remote set-url bar' ' git remote set-url someremote bar && echo bar >expect && diff --git a/t/t7409-submodule-detached-worktree.sh b/t/t7409-submodule-detached-work-tree.sh index c20717181..c20717181 100755 --- a/t/t7409-submodule-detached-worktree.sh +++ b/t/t7409-submodule-detached-work-tree.sh |