Re: [PATCH 10/9] clone: leave repo in place after checkout errors
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 26, 2013, 22:32 UTC
- Message-ID
- <20130326223259.GA28148@google.com>
- In-Reply-To
- <20130326222209.GA16457@sigill.intra.peff.net>
Jeff King wrote:
Show 11 quoted lines
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -377,10 +377,40 @@ static void remove_junk(void)
> static const char *junk_work_tree;
> static const char *junk_git_dir;
> static pid_t junk_pid;
> +enum {
> + JUNK_LEAVE_NONE,
> + JUNK_LEAVE_REPO,
> + JUNK_LEAVE_ALL
> +} junk_mode = JUNK_LEAVE_NONE;Neat.
Show 13 quoted lines
> +
> +static const char junk_leave_repo_msg[] =
> +N_("The remote repository was cloned successfully, but there was\n"
> + "an error checking out the HEAD branch. The repository has been left in\n"
> + "place but the working tree may be in an inconsistent state. You can\n"
> + "can inspect the contents with:\n"
> + "\n"
> + " git status\n"
> + "\n"
> + "and retry the checkout with\n"
> + "\n"
> + " git checkout -f HEAD\n"
> + "\n");Can this be made more precise? I don't know what it means for the working tree to be in an inconsistent state: do you mean that some files might be partially checked out or not have been checked out at all yet?
error: Clone succeeded, but checkout failed. hint: You can inspect what was checked out with "git status". hint: To retry the checkout, run "git checkout -f HEAD".
Aside from that, this looks very nice.
Thanks, Jonathan