summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:40:59 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-01-07 12:41:00 -0800
commitda178ac793047c41e4806a3c32fb421992642683 (patch)
tree65b6053da74fc52bccd25efe3687b71c3af57dd4 /t
parentMerge branch 'for-junio' of git://bogomips.org/git-svn (diff)
parentcheckout: report upstream correctly even with loosely defined branch.*.merge (diff)
downloadtgif-da178ac793047c41e4806a3c32fb421992642683.tar.xz
Merge branch 'jc/checkout-local-track-report'
The report from "git checkout" on a branch that builds on another local branch by setting its branch.*.merge to branch name (not a full refname) incorrectly said that the upstream is gone. * jc/checkout-local-track-report: checkout: report upstream correctly even with loosely defined branch.*.merge
Diffstat (limited to 't')
-rwxr-xr-xt/t2024-checkout-dwim.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t2024-checkout-dwim.sh b/t/t2024-checkout-dwim.sh
index 6ecb559465..468a000e4b 100755
--- a/t/t2024-checkout-dwim.sh
+++ b/t/t2024-checkout-dwim.sh
@@ -185,4 +185,22 @@ test_expect_success 'checkout <branch> -- succeeds, even if a file with the same
test_branch_upstream spam repo_c spam
'
+test_expect_success 'loosely defined local base branch is reported correctly' '
+
+ git checkout master &&
+ git branch strict &&
+ git branch loose &&
+ git commit --allow-empty -m "a bit more" &&
+
+ test_config branch.strict.remote . &&
+ test_config branch.loose.remote . &&
+ test_config branch.strict.merge refs/heads/master &&
+ test_config branch.loose.merge master &&
+
+ git checkout strict | sed -e "s/strict/BRANCHNAME/g" >expect &&
+ git checkout loose | sed -e "s/loose/BRANCHNAME/g" >actual &&
+
+ test_cmp expect actual
+'
+
test_done