Merge branch 'jc/doc-log-rev-list-options'
[gitweb.git] / t / t2024-checkout-dwim.sh
index 36be80fd41a7301fad657b33f028af844add60f8..468a000e4bbb113d004ee8df8ef0db9b8260fdb5 100755 (executable)
@@ -104,7 +104,7 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
                cd repo_c &&
                test_commit c_master &&
                git checkout -b bar &&
-               test_commit c_bar
+               test_commit c_bar &&
                git checkout -b spam &&
                test_commit c_spam
        ) &&
@@ -113,9 +113,9 @@ test_expect_success 'setup more remotes with unconventional refspecs' '
                cd repo_d &&
                test_commit d_master &&
                git checkout -b baz &&
-               test_commit f_baz
+               test_commit d_baz &&
                git checkout -b eggs &&
-               test_commit c_eggs
+               test_commit d_eggs
        ) &&
        git remote add repo_c repo_c &&
        git config remote.repo_c.fetch \
@@ -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