summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-21 13:57:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-21 13:57:51 (GMT)
commit45dda3a2dc7f387aa344d8f0674e8e6680a68abc (patch)
treeed776f86422e7b683b0bbdc6edf97615cde20bb7 /diff.c
parente3c18aa35bf619e36efdea2f495756bcab597b8b (diff)
parentffd04e92e2c512cbbcb99526b064af302b443cb2 (diff)
downloadgit-45dda3a2dc7f387aa344d8f0674e8e6680a68abc.zip
git-45dda3a2dc7f387aa344d8f0674e8e6680a68abc.tar.gz
git-45dda3a2dc7f387aa344d8f0674e8e6680a68abc.tar.bz2
Merge branch 'js/diff-notice-has-drive-prefix' into maint
Under certain circumstances, "git diff D:/a/b/c D:/a/b/d" on Windows would strip initial parts from the paths because they were not recognized as absolute, which has been corrected. * js/diff-notice-has-drive-prefix: diff: don't attempt to strip prefix from absolute Windows paths
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index 145cfba..db5e5e9 100644
--- a/diff.c
+++ b/diff.c
@@ -4256,12 +4256,12 @@ static void diff_fill_oid_info(struct diff_filespec *one)
static void strip_prefix(int prefix_length, const char **namep, const char **otherp)
{
/* Strip the prefix but do not molest /dev/null and absolute paths */
- if (*namep && **namep != '/') {
+ if (*namep && !is_absolute_path(*namep)) {
*namep += prefix_length;
if (**namep == '/')
++*namep;
}
- if (*otherp && **otherp != '/') {
+ if (*otherp && !is_absolute_path(*otherp)) {
*otherp += prefix_length;
if (**otherp == '/')
++*otherp;