shithub: git9

Download patch

ref: cda9631838ad97427fdbd615a20bea806cb59915
parent: 36224fde10f6d42dbd12d1bb8e4010f91f18a1a7
author: Ori Bernstein <[email protected]>
date: Sun Jun 6 09:02:38 EDT 2021

git/branch: explain why we do the mkdir dance
git/branch: unrevert the fix to the cleanpath optimization.

The cleanpath optimization was fixed, and somehow the fix
got reverted. Bring it back.

--- a/branch
+++ b/branch
@@ -74,8 +74,11 @@
 	y=$nl^$dirtypaths
 	cleanpaths=`$nl{echo $"x$nl$"y | sort | uniq -u}
 }
+
+# creating the dirs with a single
+# batch mkdir was significantly faster.
 if(! ~ $#cleanpaths 0)
-	cleandirs=`$nl{echo $nl^$cleanpaths | sed 's@/[^/]+/?$@@' | uniq}
+	cleandirs=`$nl{for(p in $cleanpaths) basename -d $p | uniq -u}
 if(! ~ $#cleandirs 0){
 	mkdir -p $cleandirs
 	mkdir -p .git/index9/tracked/$cleandirs