diff --git a/sys/src/cmd/git/import b/sys/src/cmd/git/import index d8470dd01..7ba7d0e48 100755 --- a/sys/src/cmd/git/import +++ b/sys/src/cmd/git/import @@ -45,12 +45,19 @@ fn apply @{ } state=="headers" && /^$/ { state="body" - next } (state=="headers" || state=="body") && (/^diff / || /^---( |$)/){ state="diff" } + state=="body" && /^[ ]*$/ { + empty=1 + next + } state=="body" { + if(empty) + printf "\n" > "/env/msg" + empty=0 + sub(/[ ]+$/, "") print > "/env/msg" } state=="diff" {