summaryrefslogtreecommitdiff
path: root/t/t3200-branch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-15 14:22:13 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-15 14:22:13 -0700
commit663ee1a4c9b9caa4c8f446934410ca636f998df6 (patch)
tree16709d531edb349a53910e3f7dd7c4a306b73cbb /t/t3200-branch.sh
parent936dfc220210bc00c7dc094250c9680620dab291 (diff)
parent21b5b1e8dc9bed2b518defe29d69ebc27da4b68f (diff)
downloadgit-663ee1a4c9b9caa4c8f446934410ca636f998df6.tar.gz
Merge branch 'jh/maint-do-not-track-non-branches'
* jh/maint-do-not-track-non-branches: branch/checkout --track: Ensure that upstream branch is indeed a branch
Diffstat (limited to 't/t3200-branch.sh')
-rwxr-xr-xt/t3200-branch.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index f308235f5d..78ce09f9d7 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -223,6 +223,11 @@ test_expect_success \
'branch from non-branch HEAD w/--track causes failure' \
'test_must_fail git branch --track my10 HEAD^'
+test_expect_success \
+ 'branch from tag w/--track causes failure' \
+ 'git tag foobar &&
+ test_must_fail git branch --track my11 foobar'
+
# 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
@@ -488,6 +493,15 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' '
test "z$(git config branch.myr20.rebase)" = z
'
+test_expect_success 'autosetuprebase always on detached HEAD' '
+ git config branch.autosetupmerge always &&
+ test_when_finished git checkout master &&
+ git checkout HEAD^0 &&
+ git branch my11 &&
+ test -z "$(git config branch.my11.remote)" &&
+ test -z "$(git config branch.my11.merge)"
+'
+
test_expect_success 'detect misconfigured autosetuprebase (bad value)' '
git config branch.autosetuprebase garbage &&
test_must_fail git branch