diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-27 13:02:57 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-27 13:02:57 -0800 |
commit | 60b188a9844cdcf865174c685a38acc053a9d43b (patch) | |
tree | b2ad8b5b4b20785ea137fa0ec5a11cb0b8517d8c /t | |
parent | 5a4d707a6d914fcea302e299fc18892d9e42c767 (diff) | |
parent | 572fc81d21b26d856dd3c2cc366b7452a4ed16e4 (diff) | |
download | git-60b188a9844cdcf865174c685a38acc053a9d43b.tar.gz git-60b188a9844cdcf865174c685a38acc053a9d43b.tar.xz |
Merge branch 'js/branch-track'
* js/branch-track:
doc: documentation update for the branch track changes
branch: optionally setup branch.*.merge from upstream local branches
Conflicts:
Documentation/config.txt
Documentation/git-branch.txt
Documentation/git-checkout.txt
builtin-branch.c
cache.h
t/t7201-co.sh
Diffstat (limited to 't')
-rwxr-xr-x | t/t3200-branch.sh | 22 | ||||
-rwxr-xr-x | t/t7201-co.sh | 24 |
2 files changed, 45 insertions, 1 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index d21081d0f..38a90adad 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -15,6 +15,9 @@ test_expect_success \ 'echo Hello > A && git update-index --add A && git-commit -m "Initial commit." && + echo World >> A && + git update-index --add A && + git-commit -m "Second commit." && HEAD=$(git rev-parse --verify HEAD)' test_expect_success \ @@ -171,7 +174,9 @@ test_expect_success 'test overriding tracking setup via --no-track' \ ! test "$(git config branch.my2.merge)" = refs/heads/master' test_expect_success 'no tracking without .fetch entries' \ - 'git branch --track my6 s && + 'git config branch.autosetupmerge true && + git branch my6 s && + git config branch.automsetupmerge false && test -z "$(git config branch.my6.remote)" && test -z "$(git config branch.my6.merge)"' @@ -192,6 +197,21 @@ test_expect_success 'test deleting branch without config' \ 'git branch my7 s && test "$(git branch -d my7 2>&1)" = "Deleted branch my7."' +test_expect_success 'test --track without .fetch entries' \ + 'git branch --track my8 && + test "$(git config branch.my8.remote)" && + test "$(git config branch.my8.merge)"' + +test_expect_success \ + 'branch from non-branch HEAD w/autosetupmerge=always' \ + 'git config branch.autosetupmerge always && + git branch my9 HEAD^ && + git config branch.autosetupmerge false' + +test_expect_success \ + 'branch from non-branch HEAD w/--track causes failure' \ + '!(git branch --track my10 HEAD^)' + # Keep this test last, as it changes the current branch cat >expect <<EOF 0000000000000000000000000000000000000000 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master diff --git a/t/t7201-co.sh b/t/t7201-co.sh index 724adef0b..63915cd87 100755 --- a/t/t7201-co.sh +++ b/t/t7201-co.sh @@ -313,4 +313,28 @@ test_expect_success 'checkout specific path while in subdirectory' ' ' +test_expect_success \ + 'checkout w/--track sets up tracking' ' + git config branch.autosetupmerge false && + git checkout master && + git checkout --track -b track1 && + test "$(git config branch.track1.remote)" && + test "$(git config branch.track1.merge)"' + +test_expect_success \ + 'checkout w/autosetupmerge=always sets up tracking' ' + git config branch.autosetupmerge always && + git checkout master && + git checkout -b track2 && + test "$(git config branch.track2.remote)" && + test "$(git config branch.track2.merge)" + git config branch.autosetupmerge false' + +test_expect_success \ + 'checkout w/--track from non-branch HEAD fails' ' + git checkout -b delete-me master && + rm .git/refs/heads/delete-me && + test refs/heads/delete-me = "$(git symbolic-ref HEAD)" && + !(git checkout --track -b track)' + test_done |