From da32cfac56e0a122440eef53092df74de7a839eb Mon Sep 17 00:00:00 2001
From: Spigot <noreply+git-spigot@papermc.io>
Date: Sat, 23 Mar 2013 10:05:32 +1100
Subject: [PATCH] Abort any existing patches when applying

By: md_5 <md_5@live.com.au>
---
 applyPatches.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/applyPatches.sh b/applyPatches.sh
index 70c860b4b9..8ef677fbd2 100755
--- a/applyPatches.sh
+++ b/applyPatches.sh
@@ -21,6 +21,7 @@ function applyPatch {
     git fetch upstream >/dev/null 2>&1
     git reset --hard upstream/upstream
     echo "  Applying patches to $target..."
+    git am --abort
     git am --3way $basedir/${what}-Patches/*.patch
     if [ "$?" != "0" ]; then
         echo "  Something did not apply cleanly to $target."