mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-20 01:10:02 +00:00
Further correction to tree entry sorting (for git fsck)
This commit is contained in:
parent
fb8dd803b7
commit
5bf4291637
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user