From 2ac3b25d03bac52a1f4baf694e1528e7ef97e503 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 30 May 2022 12:24:13 +0200 Subject: [PATCH] t2031: verify that `git init` can create a long path 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 --- t/t2031-checkout-long-paths.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/t2031-checkout-long-paths.sh b/t/t2031-checkout-long-paths.sh index f30f8920ca689c..d38214beea241a 100755 --- a/t/t2031-checkout-long-paths.sh +++ b/t/t2031-checkout-long-paths.sh @@ -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