Re: [PATCH] status: handle worktree renames
- From
- Igor Djordjevic <igor.d.djordjevic@gmail.com>
- Date
- Dec 25, 2017, 21:49 UTC
- Message-ID
- <fd0eb127-39b6-94fc-86c7-46fa750ec2e3@gmail.com>
- In-Reply-To
- <86b4d2af-18ce-36eb-4823-105757a196fc@gmail.com>
On 25/12/2017 20:45, Igor Djordjevic wrote:
> > I guess an additional test for this would be good, too.
... aaand here it is. Again based on your test, but please double check, I`m not sure if it`s ok to compare file modes like that, expecting them to be the same (hashes should be fine, I guess).
--- t/t2203-add-intent.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh index 41a8874e6..394b1047c 100755 --- a/t/t2203-add-intent.sh +++ b/t/t2203-add-intent.sh @@ -165,5 +165,20 @@ test_expect_success 'rename detection finds the right names' ' ) ' +test_expect_success 'rename detection finds the right names (porcelain v2)' ' + git init rename-detection-v2 && + ( + cd rename-detection-v2 && + echo contents > original-file && + git add original-file && + git commit -m first-commit && + mv original-file new-file && + git add -N new-file && + git status --porcelain=v2 | grep -v actual >actual && + echo "2 .R N... 100644 100644 100644 12f00e90b6ef79117ce6e650416b8cf517099b78 12f00e90b6ef79117ce6e650416b8cf517099b78 R100 new-file original-file" >expected && + test_cmp expected actual + ) +' + test_done
-- 2.15.1.windows.2