Skip to content

Commit

Permalink
diff-tree: use new base_name_compare() helper function
Browse files Browse the repository at this point in the history
This fixes diff-tree sorting of directories vs files (we used to
use just the regular cache_name_compare() which only works on
full file pathnames).
  • Loading branch information
Linus Torvalds committed May 20, 2005
1 parent 958ba6c commit e46091d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int compare_tree_entry(void *tree1, unsigned long size1, void *tree2, uns

pathlen1 = strlen(path1);
pathlen2 = strlen(path2);
cmp = cache_name_compare(path1, pathlen1, path2, pathlen2);
cmp = base_name_compare(path1, pathlen1, mode1, path2, pathlen2, mode2);
if (cmp < 0) {
show_file("-", tree1, size1, base);
return -1;
Expand Down

0 comments on commit e46091d

Please sign in to comment.