Re: [PATCHv10 4/4] status: better advices when splitting a commit (during rebase -i)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Junio C Hamano <gitster@xxxxxxxxx> a écrit :

+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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]