1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-23 18:26:08 +02:00
git/t/t2009-checkout-statinfo.sh
Johannes Schindelin 883b98efad t2*: adjust the references to the default branch name "main"
Carefully excluding t2106, which sees independent development elsewhere
at the time of writing, we transition above-mentioned tests to the
default branch name `main`. This trick was performed via

	$ (cd t &&
	   sed -i -e 's/master/main/g' -e 's/MASTER/MAIN/g' \
		-e 's/Master/Main/g' -- t2*.sh &&
	   git checkout HEAD -- t2106\*)

This allows us to define `GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main`
for those tests.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-19 15:44:18 -08:00

56 lines
1000 B
Bash
Executable File

#!/bin/sh
test_description='checkout should leave clean stat info'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
test_expect_success 'setup' '
echo hello >world &&
git update-index --add world &&
git commit -m initial &&
git branch side &&
echo goodbye >world &&
git update-index --add world &&
git commit -m second
'
test_expect_success 'branch switching' '
git reset --hard &&
test "$(git diff-files --raw)" = "" &&
git checkout main &&
test "$(git diff-files --raw)" = "" &&
git checkout side &&
test "$(git diff-files --raw)" = "" &&
git checkout main &&
test "$(git diff-files --raw)" = ""
'
test_expect_success 'path checkout' '
git reset --hard &&
test "$(git diff-files --raw)" = "" &&
git checkout main world &&
test "$(git diff-files --raw)" = "" &&
git checkout side world &&
test "$(git diff-files --raw)" = "" &&
git checkout main world &&
test "$(git diff-files --raw)" = ""
'
test_done