Re: [EXTERNAL] [PATCH v2 1/1] git mv foo FOO ; git mv foo bar gave an assert
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 1, 2021, 21:47 UTC
- Message-ID
- <xmqq5z2ao8am.fsf@gitster.c.googlers.com>
- In-Reply-To
- <BYAPR21MB1158CDD04067369BB367474CE09A9@BYAPR21MB1158.namprd21.prod.outlook.com>
Dan Moseley <Dan.Moseley@microsoft.com> writes:
> Thank you Thorsten. This makes sense to me. Do you want to add a test? > I believe this is what I had in my original patch, that worked pretty well:
Would this succeed unconditionally on all platforms, or only relevant on case-insensitive filesystems? Lack of any prerequisite on a new test is a good thing (if it is correct), but the description of the change talked about case insensitivity, so ...
Show 19 quoted lines
> diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh > index 63d5f41a12..5c7fee9bd8 100755 > --- a/t/t7001-mv.sh > +++ b/t/t7001-mv.sh > @@ -152,6 +152,14 @@ test_expect_success \ > 'move into "."' \ > 'git mv path1/path2/ .' > > +test_expect_success \ > + 'fail to move file already in index under different cased name' \ > + 'echo 1 > foo && > + git add foo && > + git commit -m add_file -- foo && > + git mv foo FOO && > + test_expect_code 128 git mv foo BAR' > + > test_expect_success "Michael Cassar's test case" ' > rm -fr .git papers partA && > git init &&