summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3654638)
raw | patch | inline | side by side (parent: 3654638)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 14 Feb 2006 07:07:04 +0000 (23:07 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 14 Feb 2006 07:07:04 +0000 (23:07 -0800) |
When showing a conflicted merge from index stages and working
tree file, we did not fetch the mode from the working tree,
and mistook that as a deleted file. Also if the manual
resolution (or automated resolution by git rerere) ended up
taking either parent's version, we did not show _anything_ for
that path. Either was quite bad and confusing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
tree file, we did not fetch the mode from the working tree,
and mistook that as a deleted file. Also if the manual
resolution (or automated resolution by git rerere) ended up
taking either parent's version, we did not show _anything_ for
that path. Either was quite bad and confusing.
Signed-off-by: Junio C Hamano <junkio@cox.net>
combine-diff.c | patch | blob | history |
diff --git a/combine-diff.c b/combine-diff.c
index a38f01b13ca6748ff7db613061a7715353832462..d812600d1185aa82b3a0dae69f61daca789b9322 100644 (file)
--- a/combine-diff.c
+++ b/combine-diff.c
int i, show_hunks, shown_header = 0;
char ourtmp_buf[TMPPATHLEN];
char *ourtmp = ourtmp_buf;
+ int working_tree_file = !memcmp(elem->sha1, null_sha1, 20);
/* Read the result of merge first */
- if (memcmp(elem->sha1, null_sha1, 20)) {
+ if (!working_tree_file) {
result = grab_blob(elem->sha1, &size);
write_to_temp_file(ourtmp, result, size);
}
int len = st.st_size;
int cnt = 0;
+ elem->mode = DIFF_FILE_CANON_MODE(st.st_mode);
size = len;
result = xmalloc(len + 1);
while (cnt < len) {
else {
/* deleted file */
size = 0;
+ elem->mode = 0;
result = xmalloc(1);
result[0] = 0;
ourtmp = "/dev/null";
show_hunks = make_hunks(sline, cnt, num_parent, dense);
- if (show_hunks || mode_differs) {
+ if (show_hunks || mode_differs || working_tree_file) {
const char *abb;
if (header) {
putchar('\n');
printf("index ");
for (i = 0; i < num_parent; i++) {
- if (elem->parent[i].mode != elem->mode)
- mode_differs = 1;
abb = find_unique_abbrev(elem->parent[i].sha1,
DEFAULT_ABBREV);
printf("%s%s", i ? "," : "", abb);