diff options
author | Sven Eden <yamakuzure@gmx.net> | 2018-05-15 08:22:08 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-15 08:22:08 +0200 |
commit | 5839b379233b6d95970abb83944ce6aed49c7da1 (patch) | |
tree | db8ccae22493365dc50532f1a4c9ae9ebcf89347 /pwx | |
parent | 99479c57392367015e39ff4d6c616725b60ecf80 (diff) |
migrate_tree.pl: Call 'git am --abort' if it failed to apply.
Diffstat (limited to 'pwx')
-rwxr-xr-x | pwx/migrate_tree.pl | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/pwx/migrate_tree.pl b/pwx/migrate_tree.pl index ea744c386..02960963b 100755 --- a/pwx/migrate_tree.pl +++ b/pwx/migrate_tree.pl @@ -265,15 +265,14 @@ sub apply_patch { # --------------------------------------------------------------- my $result = 1; try { - @lGitRes = $git->am( - { + @lGitRes = $git->am( { "3" => 1, - stdin => 1, -STDIN => $patch_lines } ); } catch { # We try again without 3-way-merging - show_prg( sprintf("Applying %s (2nd try)"), basename($pFile) ); + $git->am( { "abort" => 1 } ); + show_prg( sprintf("Applying %s (2nd try)", basename($pFile) ) ); $result = 0; }; $result and return $result; @@ -281,13 +280,12 @@ sub apply_patch { # --- 3) Try to apply the patch without 3-way-merging --- # --------------------------------------------------------------- try { - @lGitRes = $git->am( - { - stdin => 1, + @lGitRes = $git->am( { -STDIN => $patch_lines } ); $result = 1; } catch { + $git->am( { "abort" => 1 } ); print "\nERROR: Couldn't apply $pFile\n"; print "Exit Code : " . $_->status . "\n"; print "Message : " . $_->error . "\n"; |