ref: 682aabf9f692f310ad910910073d8f9d3839b716
parent: 658757abed7be283e06bae3b1722fc2703334d74
author: Ori Bernstein <[email protected]>
date: Mon Jun 28 14:28:08 EDT 2021
git/branch: mark files we couldn't update as dirty
--- a/sys/src/cmd/git/branch
+++ b/sys/src/cmd/git/branch
@@ -100,8 +100,10 @@
rm -rf .git/index9/tracked/$m
}
if(~ $b file){
- cp -x $basedir/tree/$m $m
- walk -eq $m > .git/index9/tracked/$m
+ if(cp -x -- $basedir/tree/$m $m)
+ walk -eq $m > .git/index9/tracked/$m
+ if not
+ echo -n > .git/index9/tracked/$m
}
}
--- a/sys/src/cmd/git/revert
+++ b/sys/src/cmd/git/revert
@@ -14,7 +14,9 @@
files=`$nl{cleanname -d $gitrel $*}
for(f in `$nl{cd $commit/tree/ && walk -f $files}){
mkdir -p `{basename -d $f}
- cp -x -- $commit/tree/$f $f
- git/add $f
+ if(cp -x -- $commit/tree/$f $f)
+ walk -eq $m > .git/index9/tracked/$m
+ if not
+ echo -n > .git/index9/tracked/$m
}
exit ''