shithub: riscv

Download patch

ref: 9f77ec48bf63083912cbcb5ef50e5561ebb3c578
parent: 44af27c55cdd14118676e96415206b3b348f69d5
author: glenda <glenda@jasnah>
date: Sun Jul 2 22:33:55 EDT 2023

git/diff: always respect the specified branch

--- a/sys/src/cmd/git/diff
+++ b/sys/src/cmd/git/diff
@@ -16,21 +16,15 @@
 
 branch=`{git/query -p $commit}
 if(~ $summarize 1){
-	git/walk -fMAR $files
+	git/walk -fMAR -b $commit $files
 	exit
 }
 
-fn lsdirty {
-	git/walk -c -fRMA $files
-	if(! ~ $commit HEAD)
-		git/query -c $commit HEAD | subst '^..'
-}
-
 showed=()
 mntgen /mnt/scratch
 bind $branch/tree/ /mnt/scratch/a
 bind . /mnt/scratch/b
-for(f in `$nl{lsdirty | sort | uniq}){
+for(f in `$nl{git/walk -c -fRMA -b $commit $files}){
 	if(~ $#showed 0){
 		echo diff `{git/query $commit} uncommitted
 		showed=1