shithub: riscv

Download patch

ref: 6076b4f9367729f60efe5a729070caaa5e38d29f
parent: 9f77ec48bf63083912cbcb5ef50e5561ebb3c578
author: glenda <glenda@jasnah>
date: Sun Jul 2 22:34:08 EDT 2023

git/revert: only look at changed files

--- a/sys/src/cmd/git/revert
+++ b/sys/src/cmd/git/revert
@@ -8,12 +8,12 @@
 if (! eval `''{aux/getflags $*} || ~ $#* 0)
 	exec aux/usage
 
-commit=$gitfs/HEAD
-if(~ $#query 1)
-	commit=`{git/query -p $query}
+if(~ $#query 0)
+	query=HEAD
+commit=`{git/query -p $query}
 
 files=`$nl{cleanname -d $gitrel $* | drop $gitroot}
-for(f in `$nl{cd $commit/tree/ && walk -f ./$files}){
+for(f in `{git/walk -c -fRM -b $query $files}){
 	mkdir -p `{basename -d $f}
 	cp -x -- $commit/tree/$f $f
 	touch $f