Re: [Bug] Rebase from worktree subdir is broken (was Re: [PATCH v5 07/11] rebase: do not attempt to remove startup_info->original_cwd)
- From
Elijah Newren <newren@gmail.com>
- Date
- Jan 26, 2022, 00:51 UTC
- Message-ID
- <CABPp-BG2__OLFkOcJnH-V8SC3hrRRrB1zv+KEOiNfoQYB9Ehpw@mail.gmail.com>
- In-Reply-To
- <CAPig+cRCzUinKr0iQkDMK0Af4=47xKZJKphcuTRxt4BaxrYwfA@mail.gmail.com>
On Tue, Jan 25, 2022 at 4:39 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 32 quoted lines
> > On Tue, Jan 25, 2022 at 7:32 PM Eric Sunshine <sunshine@sunshineco.com> wrote: > > On Tue, Jan 25, 2022 at 6:59 PM Elijah Newren <newren@gmail.com> wrote: > > > On Tue, Jan 25, 2022 at 12:27 PM Glen Choo <chooglen@google.com> wrote: > > > > +test_expect_success 'rebase when inside worktree subdirectory' ' > > > > + git init main-wt && > > > > + ( > > > > + cd main-wt && > > > > + git commit --allow-empty -m "initial" && > > > > + # create commit with foo/bar/baz > > > > + mkdir -p foo/bar && > > > > + touch foo/bar/baz && > > > > + git add foo/bar/baz && > > > > + git commit -m "add foo/bar/baz" && > > > > + # create commit with a/b/c > > > > + mkdir -p a/b && > > > > + touch a/b/c && > > > > + git add a/b/c && > > > > + git commit -m "add a/b/c" && > > > > This is entirely minor, but all the inner subshells in this test are > > superfluous. [...] > > One other minor comment: If the file's timestamp has no significance > to the test, then our style is to create the file with `>` rather than > `touch`, so: > > ... && > >foo/bar/baz && > ... > >a/b/c && > ...
Ah, good point. And while at it, we can replace the touch/add/commit sequence with a simple test_commit call.