diff options
author | John Wiegley <johnw@newartisans.com> | 2011-02-07 00:11:00 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2011-02-07 00:11:00 -0500 |
commit | 5bf42916378b49f2790b4da91cb056cd9e08f686 (patch) | |
tree | 41984062751dafb44874508fd0a6497f1aa8e65a /src/tree.c | |
parent | fb8dd803b76020cc42103b506aed4c975ca047bd (diff) | |
download | libgit2-5bf42916378b49f2790b4da91cb056cd9e08f686.tar.gz |
Further correction to tree entry sorting (for git fsck)
Diffstat (limited to 'src/tree.c')
-rw-r--r-- | src/tree.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tree.c b/src/tree.c index d71cd37d4..bf1cdfa0f 100644 --- a/src/tree.c +++ b/src/tree.c @@ -50,10 +50,10 @@ static int cache_name_compare(const char *name1, int len1, int isdir1, if (cmp) return cmp; if (len1 < len2) - return ((isdir1 == isdir2) ? -1 : + return ((!isdir1 && !isdir2) ? -1 : (isdir1 ? '/' - name2[len1] : name2[len1] - '/')); if (len1 > len2) - return ((isdir1 == isdir2) ? 1 : + return ((!isdir1 && !isdir2) ? 1 : (isdir2 ? name1[len2] - '/' : '/' - name1[len2])); return 0; } |