author | Junio C Hamano <gitster@pobox.com> | |
Wed, 29 Apr 2009 20:43:13 +0000 (13:43 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 29 Apr 2009 20:43:13 +0000 (13:43 -0700) |
* maint-1.6.0:
diff -c -p: do not die on submodules
diff -c -p: do not die on submodules
1 | 2 | |||
---|---|---|---|---|
combine-diff.c | patch | | diff1 | | diff2 | | blob | history |
t/t4027-diff-submodule.sh | patch | | diff1 | | diff2 | | blob | history |
diff --cc combine-diff.c
index bccc018ab2666e769e7865d3cad1d61f04443700,f617e9ded6b7ff2bb7a8d3629480c2ad22667428..0b071b6e256fa655b51f9e484f0633a7f055dd25
--- 1/combine-diff.c
--- 2/combine-diff.c
+++ b/combine-diff.c
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;
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;
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;
diff --cc t/t4027-diff-submodule.sh
Simple merge