And, perhaps more importantly, fix the fact that if a filename changed from a
directory to a file (or vice versa), we must consider it a delete and an add,
not a "filechange".
@ -60,13 +100,20 @@ static int compare_tree_entry(void *tree1, unsigned long size1, void *tree2, uns
@@ -60,13 +100,20 @@ static int compare_tree_entry(void *tree1, unsigned long size1, void *tree2, uns
}
if (!memcmp(sha1, sha2, 20) && mode1 == mode2)
return 0;
if (recursive && S_ISDIR(mode1) && S_ISDIR(mode2)) {
/*
* If the filemode has changed to/from a directory from/to a regular
* file, we need to consider it a remove and an add.