From: Johannes Sixt Date: Sun, 15 Nov 2020 21:42:44 GMT Subject: Re: [PATCH] rm: honor sparse checkout patterns Message-ID: <79313c8c-c927-78d4-bb1d-024f9feb553c@kdbg.org> In-Reply-To: Am 15.11.20 um 21:12 schrieb Matheus Tavares Bernardino: > Thank you both for the comments. I'll try to send v2 soon. > > On Fri, Nov 13, 2020 at 10:47 AM Derrick Stolee wrote: >> >> On 11/12/2020 6:54 PM, Elijah Newren wrote: >>> >>> Do we also want to include a testcase where the user specifies a >>> directory and part of that directory is within the sparsity paths and >>> part is out? E.g. 'git sparse-checkout set /sub/dir && git rm -r >>> sub' ? >> >> That is definitely an interesting case. > > I've added the test [1], but it's failing on Windows and I'm not quite > sure why. The trash dir artifact shows that `git sparse-checkout set > /sub/dir` produced the following path on the sparse-checkout file: > "D:/a/git/git/git-sdk-64-minimal/sub/dir". If 'git sparse-checkout' is run from a bash command line, I would not be surprised if the absolute path is munched in the way that you observe, provided that D:/a/git/git/git-sdk-64-minimal is where your MinGW subsystem is located. I that the case? > If I change the setup cmd to `git sparse-checkout set sub/dir` (i.e. > without the root slash), it works as expected. Could this be a bug, or > am I missing something? Not a bug, unless tell us that D:/a/git/git/git-sdk-64-minimal is a completely random path in your system or does not even exist. -- Hannes