shithub: plan9front

Download patch

ref: 682aabf9f692f310ad910910073d8f9d3839b716
parent: 658757abed7be283e06bae3b1722fc2703334d74
author: Ori Bernstein <ori@eigenstate.org>
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	Sat Jun 26 20:13:58 2021
+++ b/sys/src/cmd/git/branch	Mon Jun 28 14:28:08 2021
@@ -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	Sat Jun 26 20:13:58 2021
+++ b/sys/src/cmd/git/revert	Mon Jun 28 14:28:08 2021
@@ -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 ''