Skip to content

Commit

Permalink
t2031: verify that git init can create a long path
Browse files Browse the repository at this point in the history
This currently fails, with:

	++ p=/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef
	++ p=y/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef
	++ test_config_global core.longpaths true
	++ test_when_finished 'test_unconfig --global '\''core.longpaths'\'''
	++ test 0 = 0
	++ test_cleanup='{ test_unconfig --global '\''core.longpaths'\''
			} && (exit "$eval_ret"); eval_ret=$?; :'
	++ git config --global core.longpaths true
	++ git init y/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef
	fatal: cannot chdir to y/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef: No such file or directory
	error: last command exited with $?=128
	not ok 7 - init with long path

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed May 30, 2022
1 parent 7a3a4c7 commit 2ac3b25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions t/t2031-checkout-long-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,11 @@ test_expect_success SHORTABSPATH 'clean up path close to MAX_PATH' '
test ! -d "$subdir1"
'

test_expect_success 'init with long path' '
p=/123456789abcdef/123456789abcdef/123456789abcdef/123456789abc/ef &&
p=y$p$p$p$p &&
test_config_global core.longpaths true &&
git init $p
'

test_done

0 comments on commit 2ac3b25

Please sign in to comment.