summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-06 08:10:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-06 08:10:53 (GMT)
commit11f68d908229d1e954009805cd139a89872b9208 (patch)
tree154d33cfd2fc74bd84e712cf79ad1c0df839e6da /t
parent2571ac67229370e9b27d19df29f529e7fd5f7502 (diff)
downloadgit-11f68d908229d1e954009805cd139a89872b9208.zip
git-11f68d908229d1e954009805cd139a89872b9208.tar.gz
git-11f68d908229d1e954009805cd139a89872b9208.tar.bz2
git-branch --track: fix tracking branch computation.
The original code did not take hierarchical branch names into account at all. Tested-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3200-branch.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index 828d553..6f6d884 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