diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-10-30 06:43:45 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-10-30 06:43:45 (GMT) |
commit | 99499e222e8fc5b94db1fab386bd283059eb6771 (patch) | |
tree | 7a30f59fde3facfe1cec321fc925679bd737878f /diff.c | |
parent | 9d00100c3890b1f2fb4b2ea71dda49ba70be5811 (diff) | |
parent | ffd04e92e2c512cbbcb99526b064af302b443cb2 (diff) | |
download | git-99499e222e8fc5b94db1fab386bd283059eb6771.zip git-99499e222e8fc5b94db1fab386bd283059eb6771.tar.gz git-99499e222e8fc5b94db1fab386bd283059eb6771.tar.bz2 |
Merge branch 'js/diff-notice-has-drive-prefix'
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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4302,12 +4302,12 @@ static void diff_fill_oid_info(struct diff_filespec *one, struct index_state *is 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; |