X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=builtin-diff.c;h=27451d56134e08364c33c26d5074693dd4437d31;hb=fb6a9f93d39e4e5fdb83673a927f71a34e9fb7c0;hp=d3ac581f291dae630478248133344e2dd6a80b06;hpb=5c222ce2c415ccf7ce1e9281eb49f0a6f26657fa;p=git.git diff --git a/builtin-diff.c b/builtin-diff.c index d3ac581f..27451d56 100644 --- a/builtin-diff.c +++ b/builtin-diff.c @@ -122,7 +122,7 @@ static int builtin_diff_b_f(struct rev_info *revs, stuff_change(&revs->diffopt, canon_mode(st.st_mode), canon_mode(st.st_mode), blob[0].sha1, null_sha1, - blob[0].name, path); + path, path); diffcore_std(&revs->diffopt); diff_flush(&revs->diffopt); return 0; @@ -132,7 +132,9 @@ static int builtin_diff_blobs(struct rev_info *revs, int argc, const char **argv, struct blobinfo *blob) { - /* Blobs */ + /* Blobs: the arguments are reversed when setup_revisions() + * picked them up. + */ unsigned mode = canon_mode(S_IFREG | 0644); while (1 < argc) { @@ -145,8 +147,8 @@ static int builtin_diff_blobs(struct rev_info *revs, } stuff_change(&revs->diffopt, mode, mode, - blob[0].sha1, blob[1].sha1, - blob[1].name, blob[1].name); + blob[1].sha1, blob[0].sha1, + blob[0].name, blob[0].name); diffcore_std(&revs->diffopt); diff_flush(&revs->diffopt); return 0; @@ -231,7 +233,7 @@ static int builtin_diff_combined(struct rev_info *revs, return 0; } -static void add_head(struct rev_info *revs) +void add_head(struct rev_info *revs) { unsigned char sha1[20]; struct object *obj;