shithub: git9

Download patch

ref: f33ecd57228be94d3b6d777195ad93153e5c023a
parent: 388cfa1c569fed61e2c5027e1e0cefd95a5ab9a8
author: Ori Bernstein <[email protected]>
date: Thu Feb 4 11:07:29 EST 2021

git/branch: handle removed files correctly

--- a/branch
+++ b/branch
@@ -93,7 +93,8 @@
 		walk -eq $m > .git/index9/tracked/$m
 	}
 }
-for(ours in $dirtypaths){
+for(f in $dirtypaths){
+	ours=$f
 	common=/mnt/git/object/$orig/tree/$ours
 	theirs=/mnt/git/object/$base/tree/$ours
 	n=$pid
@@ -108,11 +109,17 @@
 		theirs=/dev/null
 	if(! test -f $common)
 		common=/dev/null
-	echo merging $ours...
+	echo merging $f...
 	if(! ape/diff3 -3 -m $ours $common $theirs > $tmp)
 		echo '	'merge needed: $ours
-	echo > .git/index9/tracked/$ours
-	mv $tmp $ours
+	if(test -f $f){
+		git/add $ours
+		mv $tmp $ours
+	}
+	if not {
+		git/rm $ours
+		rm $tmp
+	}
 }
 if(! ~ $#deleted 0){
 	rm -f $deleted