X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=diff.c;h=bf65892f78f84a31b6bf87b0f82cfc5938485862;hb=452c6d506b1a6dcf24d4ceaa592afc39c1c1a60e;hp=3aa695df62d2f13beed4b4ac54e3ea568194ae02;hpb=ad9d8e8f0f13e054ee30fcdcdb51973ddcfadb37;p=git.git diff --git a/diff.c b/diff.c index 3aa695df6..bf65892f7 100644 --- a/diff.c +++ b/diff.c @@ -2627,8 +2627,7 @@ static void fill_metainfo(struct strbuf *msg, (!fill_mmfile(&mf, two) && diff_filespec_is_binary(two))) abbrev = 40; } - strbuf_addf(msg, "%s%sindex %s..", set, - line_prefix, + strbuf_addf(msg, "%s%sindex %s..", line_prefix, set, find_unique_abbrev(one->sha1, abbrev)); strbuf_addstr(msg, find_unique_abbrev(two->sha1, abbrev)); if (one->mode == two->mode) @@ -2705,10 +2704,16 @@ static void diff_fill_sha1_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 && **namep != '/') { *namep += prefix_length; - if (*otherp && **otherp != '/') + if (**namep == '/') + ++*namep; + } + if (*otherp && **otherp != '/') { *otherp += prefix_length; + if (**otherp == '/') + ++*otherp; + } } static void run_diff(struct diff_filepair *p, struct diff_options *o) @@ -2815,7 +2820,6 @@ static void run_checkdiff(struct diff_filepair *p, struct diff_options *o) void diff_setup(struct diff_options *options) { memset(options, 0, sizeof(*options)); - memset(&diff_queued_diff, 0, sizeof(diff_queued_diff)); options->file = stdout;