Commit 5bf42916 by John Wiegley

Further correction to tree entry sorting (for git fsck)

parent fb8dd803
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment