Re: [PATCH v2 7/9] stash: do not attempt to remove startup_info->original_cwd
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Nov 25, 2021, 10:58 UTC
- Message-ID
- <211125.8635nkjyby.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <edec0894ca2a01c7afbc70590efd5ee8a0d1abde.1637829556.git.gitgitgadget@gmail.com>
On Thu, Nov 25 2021, Elijah Newren via GitGitGadget wrote:
Show 23 quoted lines
> From: Elijah Newren <newren@gmail.com> > > Signed-off-by: Elijah Newren <newren@gmail.com> > --- > builtin/stash.c | 6 +++++- > t/t2501-cwd-empty.sh | 2 +- > 2 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/builtin/stash.c b/builtin/stash.c > index a0ccc8654df..50b4875980c 100644 > --- a/builtin/stash.c > +++ b/builtin/stash.c > @@ -1485,8 +1485,12 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q > struct child_process cp = CHILD_PROCESS_INIT; > > cp.git_cmd = 1; > + if (startup_info->original_cwd && > + *startup_info->original_cwd && > + !is_absolute_path(startup_info->original_cwd)) > + cp.dir = startup_info->original_cwd; > strvec_pushl(&cp.args, "clean", "--force", > - "--quiet", "-d", NULL); > + "--quiet", "-d", ":/", NULL);
I saw you used :/ earlier in 01, and I commented that maybe we can use ".".
Right now I can't remember the difference. I think for tired reviewer eyes it would really help to amend the commit message to call out what desired behavior change we're getting to by adding this pathspec.