shithub: git9

Download patch

ref: 8d3a8f8fcbb24dc0de86a7702cb1a30492b450e1
parent: f9506fbcbd6abdf8072ad0c942849632b1c3d322
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Nov 28 22:52:59 EST 2020

git/import: only print one --- line

awk ends up printing in the body state, so we shouldn't
print when we transition from header to body.

This fixes the

	patch: false

message that would sometimes show up when importing a
patch.

--- a/import
+++ b/import
@@ -47,7 +47,6 @@
 	}
 	(state=="headers" || state=="body") && (/^diff/ || /^---[ 	].*$/){
 		state="diff"
-		print > ENVIRON["diffpath"]
 	}
 	state=="body" {
 		if(didthis == 0){
@@ -75,7 +74,7 @@
 		echo applying $msg | sed 1q
 		date=`{seconds $date}
 		if(! files=`$nl{ape/patch -Ep1 < $diffpath | sed ''s/^patching file `(.*)''''/\1/''})
-			die 'patch failed'
+			die ''patch failed''
 		for(f in $files){
 			if(test -e $f)
 				git/add $f