shithub: riscv

Download patch

ref: 2339cfc51541b3f62a7a92d67885b1918f8570c1
parent: 232ac9a2ca5bb3d7990abee11b59805f95b036be
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Jan 12 19:14:37 EST 2025

git/branch: missed changing a var name

--- a/sys/src/cmd/git/branch
+++ b/sys/src/cmd/git/branch
@@ -49,19 +49,19 @@
 modified=`$nl{git/query -c HEAD $base | grep '^[^-]' | subst '^..'}
 deleted=`$nl{git/query -c HEAD $base | grep '^-' | subst '^..'}
 
-# if we delete the current branch without switching, bad things happen
-if(~ $delete 1 && ~ `{git/query HEAD} `{git/query $branch})
-	die 'cannot delete current branch'
+# if we remove the current branch without switching, bad things happen
+if(~ $remove 1 && ~ `{git/query HEAD} `{git/query $branch})
+	die 'cannot remove current branch'
 # if we're not merging, don't clobber existing changes.
-if(~ $#merge 0 && ~ $#delete 0){
+if(~ $#merge 0 && ~ $#remove 0){
 	if(! ~ $#modified 0 || ! ~ $#deleted 0){
 		git/walk -fRMA $modified $deleted || 
 			die 'uncommitted changes would be clobbered'
 	}
 }
-if(~ $delete 1){
+if(~ $remove 1){
 	rm -f .git/$new
-	echo 'deleted branch' $new
+	echo 'removed branch' $new
 	exit
 }
 commit=`{git/query $base} || die 'branch does not exist:' $base
--