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?