summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2021-06-06 11:57:31 -0400
committerOri Bernstein <ori@eigenstate.org>2021-06-06 13:07:51 -0400
commitce30e785b1c7b836c6fc387314e34503fc10a91c (patch)
tree01cb8c056b6490a13abff55cfd7bd0f71f3c5692
parentfb15534c78d06bce19233da20c2fe1d23ad0c447 (diff)
downloadplan9front-ce30e785b1c7b836c6fc387314e34503fc10a91c.tar.xz
git/branch: diff clean and dirty lists correctly
no spaces in our lists.
-rwxr-xr-xsys/src/cmd/git/branch14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/src/cmd/git/branch b/sys/src/cmd/git/branch
index d132eb1e1..addfec4b6 100755
--- a/sys/src/cmd/git/branch
+++ b/sys/src/cmd/git/branch
@@ -66,13 +66,17 @@ if(! ~ $#stay 0){
}
basedir=`{git/query -p $base}
dirtypaths=()
-cleanpaths=($modified $deleted)
if(! ~ $#modified 0 || ! ~ $#deleted 0)
dirtypaths=`$nl{git/walk -cfRMA $modified $deleted}
-if(! ~ $#dirtypaths 0){
- x=$nl^$cleanpaths
- y=$nl^$dirtypaths
- cleanpaths=`$nl{echo $"x$nl$"y | sort | uniq -u}
+if(! ~ $#modified 0 || ! ~ $#deleted 0)
+ dirtypaths=`$nl{git/walk -cfRMA $modified $deleted}
+if(~ $#dirtypaths 0)
+ cleanpaths=($modified $deleted)
+if not {
+ cleanpaths=()
+ for(p in $modified $deleted)
+ if(! ~ $p $dirtypaths)
+ cleanpaths=($cleanpaths $p)
}
echo $commit > .git/$new