summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorLibravatar Lucas De Marchi <lucas.demarchi@intel.com>2018-10-24 12:46:17 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-10-25 14:47:53 +0900
commit0e573e8fcc395b5249c1c4713c2e385893c98b8c (patch)
treef58b15fa4230d818ec1ee0aa1adb6762901ca0a4 /builtin/receive-pack.c
parentThird batch for 2.20 (diff)
downloadtgif-0e573e8fcc395b5249c1c4713c2e385893c98b8c.tar.xz
range-diff: allow to diff files regardless of submodule config
If we have `submodule.diff = log' in the configuration file or `--submodule=log' is given as argument, range-diff fails to compare both diffs and we only get the following output: Submodule a 0000000...0000000 (new submodule) Even if the repository doesn't have any submodule. That's because the mode in diff_filespec is not correct and when flushing the diff, down in builtin_diff() we will enter the condition: if (o->submodule_format == DIFF_SUBMODULE_LOG && (!one->mode || S_ISGITLINK(one->mode)) && (!two->mode || S_ISGITLINK(two->mode))) { show_submodule_summary(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); return; It turns out that S_ISGITLINK will return true (mode == 0160000 here). Similar thing happens if submodule.diff is "diff". Do like it's done in grep.c when calling fill_filespec() and force it to be recognized as a file by adding S_IFREG to the mode. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/receive-pack.c')
0 files changed, 0 insertions, 0 deletions