Re: [PATCH] diff: don't attempt to strip prefix from absolute Windows paths
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 18, 2018, 19:11 UTC
- Message-ID
- <a9a51e28-208d-d8dd-a868-bc2f8cc79598@kdbg.org>
- In-Reply-To
- <CAGZ79kYChLNDB_f1KR2k7G9FvHkX7x_yXdhxMRpLFWpRR0SoPg@mail.gmail.com>
Am 18.10.18 um 20:49 schrieb Stefan Beller:
Show 7 quoted lines
> On Thu, Oct 18, 2018 at 11:38 AM Johannes Sixt <j6t@kdbg.org> wrote: > >> There is one peculiarity, though: [...] > > The explanation makes sense, and the code looks good. > Do we want to have a test for this niche case? >
Good point. That would be the following. But give me a day or two to cross-check on Windows and whether it really catches the breakage.
diff --git a/t/t4053-diff-no-index.sh b/t/t4053-diff-no-index.sh index 453e6c35eb..6e0dd6f9e5 100755 --- a/t/t4053-diff-no-index.sh +++ b/t/t4053-diff-no-index.sh @@ -127,4 +127,14 @@ test_expect_success 'diff --no-index from repo subdir respects config (implicit) test_cmp expect actual.head ' +test_expect_success 'diff --no-index from repo subdir with absolute paths' ' + cat <<-EOF >expect && + 1 1 $(pwd)/non/git/{a => b} + EOF + test_expect_code 1 \ + git -C repo/sub diff --numstat \ + "$(pwd)/non/git/a" "$(pwd)/non/git/b" >actual && + test_cmp expect actual +' + test_done