Re: [RFC PATCH 1/1] mv: integrate with sparse-index
- From
Derrick Stolee <derrickstolee@github.com>
- Date
- Mar 16, 2022, 13:34 UTC
- Message-ID
- <675c7681-c495-727d-1262-ee8c6a5c8ce5@github.com>
- In-Reply-To
- <CAJyCBORDOJUwTzOC+hYwGGPUBCXST0_mBdwRLh2N+cA=5k0d4A@mail.gmail.com>
On 3/16/2022 6:45 AM, Shaoxuan Yuan wrote:
Show 9 quoted lines
> Hi Victoria, > > Just found an interesting (probably) behavior. > > In the `sparse-checkout` directory created in `init_repos()` in t1092, if I > say: > > $ mkdir folder3 > $ touch folder3/a
The issue here is that this file is "untracked", not just outside of the sparse-checkout cone.
Show 17 quoted lines
> $ git mv folder3/a deep > > and git will prompt: > > "fatal: not under version control, source=folder3/a, destination=deep/a" > > And if I say: > > $ git mv folder3 deep > > git will prompt: > > "fatal: source directory is empty, source=folder3, destination=deep/folder3" > > What I am wondering is that file `folder3/a` is outside of sparse-checkout cone, > should `git mv` instead prompts with `advise_on_updating_sparse_paths()` or this > "not under version control" alarm is acceptable?
Instead, what about
git mv folder2/a deep/new
since folder2/a is a tracked file, just not in the working tree since it is outside the sparse-checkout cone.
(If it fails, then it should fail the same with and without the sparse index, which is what "test_sparse_match" is for.)
Thanks, -Stolee