commit - 9185b86391a5c4ff9989ab6755b815050869848c
commit + 19ae6da15b9c1e2c10f4c66f2b654813419eb9cf
blob - 23f25d0554bd5167a5ef0b5b6cb58e05f4c57cd1
blob + f25183814363b9d6c4c7e087e898de3d6e9d18a1
--- lib/diff.c
+++ lib/diff.c
struct got_repository *repo, FILE *outfile)
{
const struct got_error *err = NULL;
+ int id_match;
if (te2 == NULL) {
if (S_ISDIR(te1->mode))
return err;
}
+ id_match = (got_object_id_cmp(te1->id, te2->id) == 0);
if (S_ISDIR(te1->mode) && S_ISDIR(te2->mode)) {
- if (got_object_id_cmp(te1->id, te2->id) != 0)
+ if (!id_match)
return diff_modified_tree(te1->id, te2->id,
label1, label2, diff_context, repo, outfile);
} else if (S_ISREG(te1->mode) && S_ISREG(te2->mode)) {
- if (got_object_id_cmp(te1->id, te2->id) != 0)
+ if (!id_match)
return diff_modified_blob(te1->id, te2->id,
label1, label2, diff_context, repo, outfile);
}
- if (got_object_id_cmp(te1->id, te2->id) == 0)
+ if (id_match)
return NULL;
return diff_kind_mismatch(te1->id, te2->id, label1, label2, outfile);