summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-09-30 19:01:54 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-09-30 19:01:56 -0400
commitb970c69ba85a807ef9f0828feb801d9f0aadbdd2 (patch)
tree9c15f0bf712b925e60db03f3ea1b656f6239b55b
parentd02bb64f70cb45bfbc4260f6ebc82d0dabb5f71c (diff)
parentf49cd5f6a82f7bc1e9df9eead0a9e1e5b4d843bc (diff)
make: post-commit: only stash if necessary
-rwxr-xr-xpost-commit16
1 files changed, 12 insertions, 4 deletions
diff --git a/post-commit b/post-commit
index 6abf27a..d3a81ba 100755
--- a/post-commit
+++ b/post-commit
@@ -2,15 +2,23 @@
branch=$(git name-rev --name-only HEAD)
if [[ $branch == master ]]; then
- git add .
- git stash
+
+ stash=false
+ if [[ -n "$(git status --porcelain)" ]]; then
+ stash=true
+ git add .
+ git stash
+ fi
git checkout pre-generated
git merge master -m 'bogus'
make --always-make -j12
git add .
git commit --amend -m "make: $(git log -n1 master --pretty=format:%B)"
-
git checkout master
- git stash pop
+
+ if $stash; then
+ git stash pop
+ fi
+
fi