Re: [PATCHv10 4/4] status: better advices when splitting a commit (during rebase -i)
- From
- konglu@minatec.inpg.fr <konglu@minatec.inpg.fr>
- Date
- Jun 12, 2012, 07:14 UTC
- Message-ID
- <20120612091412.Horde.lcugXXwdC4BP1uxEDLrRNgA@webmail.minatec.grenoble-inp.fr>
- In-Reply-To
- <7vsje161lx.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> a écrit :
Show 25 quoted lines
>> +static int split_commit_in_progress(struct wt_status *s)
>> +{
>> + int split_in_progress = 0;
>> + char *head = read_line_from_git_path("HEAD");
>> + char *orig_head = read_line_from_git_path("ORIG_HEAD");
>> + char *rebase_amend = read_line_from_git_path("rebase-merge/amend");
>> + char *rebase_orig_head =
>> read_line_from_git_path("rebase-merge/orig-head");
>> +
>> + if (!head || !orig_head || !rebase_amend || !rebase_orig_head ||
>> !prefixcmp(head, "ref: "))
>> + return split_in_progress;
>
> I think the above
>
> !prefixcmp(head, "ref: ")
>
> is probably a mistake; shouldn't it be
>
> strcmp(s->branch, "HEAD")
>
> which is used in wt_status_print() to diagnose that you are on a
> detached HEAD (which is the normal case)? Otherwise head may point
> at the commit object name read from "refs/heads/current" through a
> symbolic link .git/HEAD that points at "refs/heads/current".Aah, that's the variable I was looking for. Thanks for fixing it up :).
Lucien Kong