Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:54:00

Lucien Kong [off-list ref] writes:
+static int split_commit_in_progress(struct wt_status *s)
+{
+	int split_in_progress = 0;
+	const char *head = read_line_from_git_path("HEAD");
+	const char *orig_head = read_line_from_git_path("ORIG_HEAD");
+	const char *rebase_amend = read_line_from_git_path("rebase-merge/amend");
+	const char *rebase_orig_head = read_line_from_git_path("rebase-merge/orig-head");
By declaring these newly allocated memory you own in this function
and free() yourself as "const char *", the only thing you are
gaining is the need to cast constness away when you call free().

Why are these necessary?
+	if (!head || !orig_head || !rebase_amend ||
+			!rebase_orig_head || !prefixcmp(head, "refs/heads/"))
+		return split_in_progress;
Can't .git/HEAD be a symlinked symref?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help