{"thread":{"id":"65050","subject":"[PATCH] t2018: move checkout case-insensitive test from t0050","startedAt":"2026-02-23T09:03:21Z","lastAt":"2026-02-23T17:04:48Z","messageCount":3,"participants":["Md Ferdous Alam via GitGitGadget","Junio C Hamano","Elijah Newren"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"536716","messageId":"pull.2054.git.1771837399472.gitgitgadget@gmail.com","threadId":"65050","inReplyTo":null,"subject":"[PATCH] t2018: move checkout case-insensitive test from t0050","fromName":"Md Ferdous Alam via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-02-23T09:03:19Z","receivedAt":"2026-02-23T09:03:21Z","isPatch":true,"sender":{"key":"name:Md Ferdous Alam","avatar":null},"body":"From: mdferdousalam <mdferdousalam1989@yahoo.com>\n\nThe test 'checkout with no pathspec and a case insensitive fs' in\nt0050 does not really belong there as it tests branch checkout\nbehavior, not filesystem properties.  It also had an unnecessary\nCASE_INSENSITIVE_FS prereq since the sequence of commands should\nsucceed on any filesystem, and it did not verify the resulting\nworktree contents.\n\nMove it to t2018-checkout-branch.sh where it belongs, drop the\nprereq, and add a check that the expected file is present after\nthe checkout.\n\nSigned-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>\n---\n    t2018: move checkout case-insensitive test from t0050\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2054%2Fmdferdousalam%2Fmove-checkout-test-from-t0050-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2054/mdferdousalam/move-checkout-test-from-t0050-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2054\n\n t/t0050-filesystem.sh      | 20 --------------------\n t/t2018-checkout-branch.sh | 21 +++++++++++++++++++++\n 2 files changed, 21 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh\nindex ca8568067d..003329c082 100755\n--- a/t/t0050-filesystem.sh\n+++ b/t/t0050-filesystem.sh\n@@ -117,24 +117,4 @@ $test_unicode 'merge (silent unicode normalization)' '\n \tgit merge topic\n '\n \n-test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case insensitive fs' '\n-\tgit init repo &&\n-\t(\n-\t\tcd repo &&\n-\n-\t\t>Gitweb &&\n-\t\tgit add Gitweb &&\n-\t\tgit commit -m \"add Gitweb\" &&\n-\n-\t\tgit checkout --orphan todo &&\n-\t\tgit reset --hard &&\n-\t\tmkdir -p gitweb/subdir &&\n-\t\t>gitweb/subdir/file &&\n-\t\tgit add gitweb &&\n-\t\tgit commit -m \"add gitweb/subdir/file\" &&\n-\n-\t\tgit checkout main\n-\t)\n-'\n-\n test_done\ndiff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh\nindex a48ebdbf4d..5f37e40591 100755\n--- a/t/t2018-checkout-branch.sh\n+++ b/t/t2018-checkout-branch.sh\n@@ -285,4 +285,25 @@ test_expect_success 'checkout -b rejects an extra path argument' '\n \ttest_grep \"Cannot update paths and switch to branch\" err\n '\n \n+test_expect_success 'checkout a branch when file and directory share case-insensitive name' '\n+\tgit init repo-case &&\n+\t(\n+\t\tcd repo-case &&\n+\n+\t\t>Gitweb &&\n+\t\tgit add Gitweb &&\n+\t\tgit commit -m \"add Gitweb\" &&\n+\n+\t\tgit checkout --orphan other &&\n+\t\tgit reset --hard &&\n+\t\tmkdir -p gitweb/subdir &&\n+\t\t>gitweb/subdir/file &&\n+\t\tgit add gitweb &&\n+\t\tgit commit -m \"add gitweb/subdir/file\" &&\n+\n+\t\tgit checkout master &&\n+\t\ttest_path_is_file Gitweb\n+\t)\n+'\n+\n test_done\n\nbase-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4\n-- \ngitgitgadget\n"},{"id":"536828","messageId":"xmqqjyw3o2w2.fsf@gitster.g","threadId":"65050","inReplyTo":"pull.2054.git.1771837399472.gitgitgadget@gmail.com","subject":"Re: [PATCH] t2018: move checkout case-insensitive test from t0050","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-23T16:12:13Z","receivedAt":"2026-02-23T16:12:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Md Ferdous Alam via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\nAdding CC the authors of 69f272b9 (dir: special case check for the\npossibility that pathspec is NULL, 2019-10-01) and 06d53148 (t[01]*:\nadjust the references to the default branch name \"main\", 2020-11-18)\nthe block of lines removed by this patch are blamed for.\n\nOne thing that I noticed that needs checking but I didn't do so\nmyself is that the original is prepared not to break after Git 3.0\nby using 'main' in t0050 (which forces the initial branch name to be\n'main').  Whereever the corresponding new code goes, there needs a\nsimilar provision to prevent the test from getting broken with the\ndefault change.\n\nI think specifying the initial branch name explicitly when the test\ncreates \"repo-case\" test repository and use that to go back to that\nbranch would be better for the purpose of this single test, rather\nthan using the blanket \"GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\" for\nthe entire script.\n\n\n> From: mdferdousalam <mdferdousalam1989@yahoo.com>\n>\n> The test 'checkout with no pathspec and a case insensitive fs' in\n> t0050 does not really belong there as it tests branch checkout\n> behavior, not filesystem properties.  It also had an unnecessary\n> CASE_INSENSITIVE_FS prereq since the sequence of commands should\n> succeed on any filesystem, and it did not verify the resulting\n> worktree contents.\n>\n> Move it to t2018-checkout-branch.sh where it belongs, drop the\n> prereq, and add a check that the expected file is present after\n> the checkout.\n>\n> Signed-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>\n> ---\n>     t2018: move checkout case-insensitive test from t0050\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2054%2Fmdferdousalam%2Fmove-checkout-test-from-t0050-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2054/mdferdousalam/move-checkout-test-from-t0050-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/2054\n>\n>  t/t0050-filesystem.sh      | 20 --------------------\n>  t/t2018-checkout-branch.sh | 21 +++++++++++++++++++++\n>  2 files changed, 21 insertions(+), 20 deletions(-)\n>\n> diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh\n> index ca8568067d..003329c082 100755\n> --- a/t/t0050-filesystem.sh\n> +++ b/t/t0050-filesystem.sh\n> @@ -117,24 +117,4 @@ $test_unicode 'merge (silent unicode normalization)' '\n>  \tgit merge topic\n>  '\n>  \n> -test_expect_success CASE_INSENSITIVE_FS 'checkout with no pathspec and a case insensitive fs' '\n> -\tgit init repo &&\n> -\t(\n> -\t\tcd repo &&\n> -\n> -\t\t>Gitweb &&\n> -\t\tgit add Gitweb &&\n> -\t\tgit commit -m \"add Gitweb\" &&\n> -\n> -\t\tgit checkout --orphan todo &&\n> -\t\tgit reset --hard &&\n> -\t\tmkdir -p gitweb/subdir &&\n> -\t\t>gitweb/subdir/file &&\n> -\t\tgit add gitweb &&\n> -\t\tgit commit -m \"add gitweb/subdir/file\" &&\n> -\n> -\t\tgit checkout main\n> -\t)\n> -'\n> -\n>  test_done\n> diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh\n> index a48ebdbf4d..5f37e40591 100755\n> --- a/t/t2018-checkout-branch.sh\n> +++ b/t/t2018-checkout-branch.sh\n> @@ -285,4 +285,25 @@ test_expect_success 'checkout -b rejects an extra path argument' '\n>  \ttest_grep \"Cannot update paths and switch to branch\" err\n>  '\n>  \n> +test_expect_success 'checkout a branch when file and directory share case-insensitive name' '\n> +\tgit init repo-case &&\n> +\t(\n> +\t\tcd repo-case &&\n> +\n> +\t\t>Gitweb &&\n> +\t\tgit add Gitweb &&\n> +\t\tgit commit -m \"add Gitweb\" &&\n> +\n> +\t\tgit checkout --orphan other &&\n> +\t\tgit reset --hard &&\n> +\t\tmkdir -p gitweb/subdir &&\n> +\t\t>gitweb/subdir/file &&\n> +\t\tgit add gitweb &&\n> +\t\tgit commit -m \"add gitweb/subdir/file\" &&\n> +\n> +\t\tgit checkout master &&\n> +\t\ttest_path_is_file Gitweb\n> +\t)\n> +'\n> +\n>  test_done\n>\n> base-commit: 7c02d39fc2ed2702223c7674f73150d9a7e61ba4\n"},{"id":"536852","messageId":"CABPp-BENP2tUt1MufKeGxXwgr+iHEDnXjOLsaFk7OPkbOsLAMw@mail.gmail.com","threadId":"65050","inReplyTo":"xmqqjyw3o2w2.fsf@gitster.g","subject":"Re: [PATCH] t2018: move checkout case-insensitive test from t0050","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2026-02-23T17:04:36Z","receivedAt":"2026-02-23T17:04:48Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Mon, Feb 23, 2026 at 8:12 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Md Ferdous Alam via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n> Adding CC the authors of 69f272b9 (dir: special case check for the\n> possibility that pathspec is NULL, 2019-10-01) and 06d53148 (t[01]*:\n> adjust the references to the default branch name \"main\", 2020-11-18)\n> the block of lines removed by this patch are blamed for.\n>\n> One thing that I noticed that needs checking but I didn't do so\n> myself is that the original is prepared not to break after Git 3.0\n> by using 'main' in t0050 (which forces the initial branch name to be\n> 'main').  Whereever the corresponding new code goes, there needs a\n> similar provision to prevent the test from getting broken with the\n> default change.\n>\n> I think specifying the initial branch name explicitly when the test\n> creates \"repo-case\" test repository and use that to go back to that\n> branch would be better for the purpose of this single test, rather\n> than using the blanket \"GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\" for\n> the entire script.\n>\n>\n> > From: mdferdousalam <mdferdousalam1989@yahoo.com>\n> >\n> > The test 'checkout with no pathspec and a case insensitive fs' in\n> > t0050 does not really belong there as it tests branch checkout\n> > behavior, not filesystem properties.  It also had an unnecessary\n> > CASE_INSENSITIVE_FS prereq since the sequence of commands should\n> > succeed on any filesystem, and it did not verify the resulting\n> > worktree contents.\n\nActually, the CASE_INSENSTIVE_FS was very much intentional and\ncritical to triggering the original bug before it was fixed, and in\nfact was overlooked by both Denton (the original reporter) and I,\nwhich made us unable to figure out how to reproduce the segfault he\nhad triggered.  (The testcase does use both \"Gitweb\" and \"gitweb\" in\nit as paths).  Luckily, Gábor came along and noticed the case\ndifferences and created a testcase for us, and then I dug further for\nother surrounding issues with that initial guide.  See the threads\naround https://lore.kernel.org/git/20190925215530.GA9013@generichostname/\nand https://lore.kernel.org/git/20190927021746.GL2637@szeder.dev/\n\n> > Move it to t2018-checkout-branch.sh where it belongs, drop the\n> > prereq,\n\nI think it belongs where it already is, and the prereq should be kept.\n\n> > and add a check that the expected file is present after\n> > the checkout.\n\nNot sure if that's worth changing, but if others feel strongly then it\ndoesn't hurt anything.\n\n> >\n> > Signed-off-by: mdferdousalam <mdferdousalam1989@yahoo.com>\n\nFrom Documentation/SubmittingPatches:\n\n\"\"\"\nPlease use a known identity in the `Signed-off-by` trailer, since we cannot\naccept anonymous contributions. It is common, but not required, to use some form\nof your real name. We realize that some contributors are not comfortable doing\nso or prefer to contribute under a pseudonym or preferred name and we can accept\nyour patch either way, as long as the name and email you use are distinctive,\nidentifying, and not misleading.\n\nThe goal of this policy is to allow us to have sufficient information to contact\nyou if questions arise about your contribution.\n\"\"\"\n\nSince your patch was sent by \"Md Ferdous Alam via GitGitGadget\" I\nsuspect that your Signoff should have been \"Signed-off-by: Md Ferdous\nAlam <mdferdousalam1989@yahoo.com>\" (and the From line updated to\nmatch).  If I'm wrong about that, it might be helpful for you to\ninclude an explanation of the name differences with or before your\nnext patch submission.\n"}]}