Re: [PATCH 2/4] builtin/worktree.c: Update checkout_worktree() to use git-worktree
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Nov 4, 2022, 01:32 UTC
- Message-ID
- <221104.86sfizzeq7.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20221104010242.11555-3-jacobabel@nullpo.dev>
On Fri, Nov 04 2022, Jacob Abel wrote:
Show 21 quoted lines
> Updates the function to call `git checkout` instead of
> `git reset --hard` to simplify adding orphan support.
>
> Signed-off-by: Jacob Abel <jacobabel@nullpo.dev>
> ---
> builtin/worktree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/builtin/worktree.c b/builtin/worktree.c
> index b3373fbbd6..d40f771848 100644
> --- a/builtin/worktree.c
> +++ b/builtin/worktree.c
> @@ -357,7 +357,7 @@ static int checkout_worktree(const struct add_opts *opts,
> {
> struct child_process cp = CHILD_PROCESS_INIT;
> cp.git_cmd = 1;
> - strvec_pushl(&cp.args, "reset", "--hard", "--no-recurse-submodules", NULL);
> + strvec_pushl(&cp.args, "checkout", "--no-recurse-submodules", NULL);
> if (opts->quiet)
> strvec_push(&cp.args, "--quiet");
> strvec_pushv(&cp.env, child_env->v);Won't we now start to run the post-checkout when doing this, and is that intended?