On Thu, Nov 25, 2021 at 2:58 AM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > > On Thu, Nov 25 2021, Elijah Newren via GitGitGadget wrote: > > > From: Elijah Newren <newren@xxxxxxxxx> > > > > Signed-off-by: Elijah Newren <newren@xxxxxxxxx> > > --- > > 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 > ".". I tweaked that other one to avoid :/ a different way. > 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. Yeah, I want the ':/' to be explicit that it should clean from the toplevel of the repository despite starting in a subdirectory; I'll amend the commit message.