From: Per Cederqvist Date: Sun, 18 May 2014 21:59:42 GMT Subject: [GUILT v4 06/33] Fix the do_get_patch function. Message-ID: <1400450409-30998-7-git-send-email-cederp@opera.com> In-Reply-To: <1400450409-30998-1-git-send-email-cederp@opera.com> A patch file consists of: (1) the description (2) optional diffstat (3) the patches When extracting the patch, we only want part 3. The do_get_patch used to give us part 2 and part 3. That made for instance this series of operations fail if guilt.diffstat is true: $ guilt new empty-1 $ guilt new empty-2 $ guilt pop Now at empty-1 $ guilt fold empty-2 $ guilt pop All patches popped. $ guilt push Applying patch..empty-1 fatal: unrecognized input To force apply this patch, use 'guilt push -f' Signed-off-by: Per Cederqvist Signed-off-by: Josef 'Jeff' Sipek --- guilt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guilt b/guilt index 8701481..3fc524e 100755 --- a/guilt +++ b/guilt @@ -334,7 +334,7 @@ do_get_patch() { awk ' BEGIN{} -/^(diff |---$|--- )/ {patch = 1} +/^(diff |--- )/ {patch = 1} patch == 1 {print $0} END{} ' < "$1" -- 1.8.3.1