git: 9front

Download patch

ref: 125264d00dfee55ed9e3ebe54a7d3768faa756c2
parent: c4d3c02704eef6b2588244bd53ae953498d12044
author: Michael Forney <mforney@mforney.org>
date: Mon Oct 3 13:33:03 EDT 2022

git/import: remove removed files from index after commit

Otherwise, they stick around in the index even though they aren't
present in the checkout or the commit. This causes various git tools
to bail out since they think the tree is dirty.

--- a/sys/src/cmd/git/import
+++ b/sys/src/cmd/git/import
@@ -96,8 +96,10 @@
 		}
 		git/walk -fRMA $files
 		if(~ $#nocommit 0){
-			if(hash=`{git/save -n $aname -e $amail -N $name -E $email -m $msg -d $date $parents $files})
+			if(hash=`{git/save -n $aname -e $amail -N $name -E $email -m $msg -d $date $parents $files}){
 				echo $hash > $refpath
+				rm -f .git/index9/removed/$files
+			}
 		}
 		status=''''
 	'
--