aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2019-03-11 14:15:44 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2019-03-11 18:05:58 -0400
commitb170479336afa1577c70db5d9c9a8c0c86441245 (patch)
tree68dee37e8a94fb1183b81da8bfadbec1aa63a20b
parentd66e1de3fd7af5a59fa7ccbabef7e6d8e2a7edaf (diff)
downloadlibrebootfr-b170479336afa1577c70db5d9c9a8c0c86441245.tar.gz
librebootfr-b170479336afa1577c70db5d9c9a8c0c86441245.zip
libs/git: Clean up after patch fails to apply
A patch failing to apply shouldn't leave the repository in such a state where manual intervention is necessary to reset it.
-rwxr-xr-xlibs/git3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/git b/libs/git
index 1ca2358e..03df3537 100755
--- a/libs/git
+++ b/libs/git
@@ -179,7 +179,8 @@ git_patch() {
cd "$repository_path"
git checkout "$branch" 2> /dev/null > /dev/null
- git am "$patch"
+
+ git am "$patch" || git am --abort
)
}