diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-06-15 23:35:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-15 23:35:32 -0700 |
commit | 7b99befef7d0ae173980f531e80916126011ca41 (patch) | |
tree | 34407330acced16567fc535705768d097e67d22b /t | |
parent | $EMAIL is a last resort fallback, as it's system-wide. (diff) | |
download | tgif-7b99befef7d0ae173980f531e80916126011ca41.tar.xz |
git-branch --track: fix tracking branch computation.
The original code did not take hierarchical branch names into account at all.
[jc: cherry-picked 11f68d9 from 'master']
Tested-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3200-branch.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 828d553a4b..6f6d8844e8 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -136,8 +136,8 @@ test_expect_success 'test tracking setup (non-wildcard, not matching)' \ git-config remote.local.fetch refs/heads/s:refs/remotes/local/s && (git-show-ref -q refs/remotes/local/master || git-fetch local) && git-branch --track my5 local/master && - ! test $(git-config branch.my5.remote) = local && - ! test $(git-config branch.my5.merge) = refs/heads/master' + ! test "$(git-config branch.my5.remote)" = local && + ! test "$(git-config branch.my5.merge)" = refs/heads/master' test_expect_success 'test tracking setup via config' \ 'git-config branch.autosetupmerge true && @@ -155,14 +155,22 @@ test_expect_success 'test overriding tracking setup via --no-track' \ (git-show-ref -q refs/remotes/local/master || git-fetch local) && git-branch --no-track my2 local/master && git-config branch.autosetupmerge false && - ! test $(git-config branch.my2.remote) = local && - ! test $(git-config branch.my2.merge) = refs/heads/master' + ! test "$(git-config branch.my2.remote)" = local && + ! test "$(git-config branch.my2.merge)" = refs/heads/master' test_expect_success 'test local tracking setup' \ 'git branch --track my6 s && test $(git-config branch.my6.remote) = . && test $(git-config branch.my6.merge) = refs/heads/s' +test_expect_success 'test tracking setup via --track but deeper' \ + 'git-config remote.local.url . && + git-config remote.local.fetch refs/heads/*:refs/remotes/local/* && + (git-show-ref -q refs/remotes/local/o/o || git-fetch local) && + git-branch --track my7 local/o/o && + test "$(git-config branch.my7.remote)" = local && + test "$(git-config branch.my7.merge)" = refs/heads/o/o' + # 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 |