Skip to content

Commit

Permalink
Merge pull request #2986 from dscho/t7422-and-the-default-branch-name
Browse files Browse the repository at this point in the history
Prepare `long-paths` for upcoming upstream changes
  • Loading branch information
dscho authored Jan 20, 2021
2 parents 39cf94c + 6583578 commit 5c76a52
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions t/t7422-submodule-long-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ pwdlen=$(echo "$pwd" | wc -c)
longpath=$(echo $longpath180 | cut -c 1-$((170-$pwdlen)))

test_expect_success 'submodule with a long path' '
git init --bare remote &&
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=long init --bare remote &&
test_create_repo bundle1 &&
(
cd bundle1 &&
Expand All @@ -37,21 +38,22 @@ test_expect_success 'submodule with a long path' '
cd home &&
git clone ../remote test &&
cd test &&
git checkout -B long &&
git submodule add ../bundle1 $longpath &&
test_commit "sogood" &&
(
cd $longpath &&
git rev-parse --verify HEAD >actual &&
test_cmp ../../../expect actual
) &&
git push origin master
git push origin long
) &&
mkdir home2 &&
(
cd home2 &&
git clone ../remote test &&
cd test &&
git checkout master &&
git checkout long &&
git submodule update --init &&
(
cd $longpath &&
Expand All @@ -62,7 +64,8 @@ test_expect_success 'submodule with a long path' '
'

test_expect_success 'recursive submodule with a long path' '
git init --bare super &&
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME= \
git -c init.defaultBranch=long init --bare super &&
test_create_repo child &&
(
cd child &&
Expand All @@ -80,6 +83,7 @@ test_expect_success 'recursive submodule with a long path' '
cd home3 &&
git clone ../super test &&
cd test &&
git checkout -B long &&
git submodule add ../parent foo &&
git submodule update --init --recursive &&
test_commit "sogood" &&
Expand All @@ -88,7 +92,7 @@ test_expect_success 'recursive submodule with a long path' '
git rev-parse --verify HEAD >actual &&
test_cmp ../../../../expect actual
) &&
git push origin master
git push origin long
) &&
mkdir home4 &&
(
Expand Down

0 comments on commit 5c76a52

Please sign in to comment.