From: Junio C Hamano Date: Wed, 29 Apr 2009 20:43:13 +0000 (-0700) Subject: Merge branch 'maint-1.6.0' into maint-1.6.1 X-Git-Tag: v1.6.3-rc4~6^2^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=934747323c397ffe64b6dcdf2bf73128d8e36968;p=git.git Merge branch 'maint-1.6.0' into maint-1.6.1 * maint-1.6.0: diff -c -p: do not die on submodules --- 934747323c397ffe64b6dcdf2bf73128d8e36968 diff --cc combine-diff.c index bccc018ab,f617e9ded..0b071b6e2 --- a/combine-diff.c +++ b/combine-diff.c @@@ -211,12 -221,14 +219,12 @@@ static void combine_diff(const unsigne if (!cnt) return; /* result deleted */ - parent_file.ptr = grab_blob(parent, &sz); + parent_file.ptr = grab_blob(parent, mode, &sz); parent_file.size = sz; + memset(&xpp, 0, sizeof(xpp)); xpp.flags = XDF_NEED_MINIMAL; memset(&xecfg, 0, sizeof(xecfg)); - ecb.outf = xdiff_outf; - ecb.priv = &state; memset(&state, 0, sizeof(state)); - state.xm.consume = consume_line; state.nmask = nmask; state.sline = sline; state.lno = 1; @@@ -688,12 -698,9 +696,12 @@@ static void show_patch_diff(struct comb mmfile_t result_file; context = opt->context; + a_prefix = opt->a_prefix ? opt->a_prefix : "a/"; + b_prefix = opt->b_prefix ? opt->b_prefix : "b/"; + /* Read the result of merge first */ if (!working_tree_file) - result = grab_blob(elem->sha1, &result_size); + result = grab_blob(elem->sha1, elem->mode, &result_size); else { /* Used by diff-tree to read from the working tree */ struct stat st; @@@ -710,12 -718,15 +718,16 @@@ strerror(errno)); return; } - result[len] = 0; + result_size = buf.len; + result = strbuf_detach(&buf, NULL); elem->mode = canon_mode(st.st_mode); - } - else if (0 <= (fd = open(elem->path, O_RDONLY)) && - !fstat(fd, &st)) { + } else if (S_ISDIR(st.st_mode)) { + unsigned char sha1[20]; + if (resolve_gitlink_ref(elem->path, "HEAD", sha1) < 0) + result = grab_blob(elem->sha1, elem->mode, &result_size); + else + result = grab_blob(sha1, elem->mode, &result_size); + } else if (0 <= (fd = open(elem->path, O_RDONLY))) { size_t len = xsize_t(st.st_size); ssize_t done; int is_file, i;