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:54 -0400
commitf49cd5f6a82f7bc1e9df9eead0a9e1e5b4d843bc (patch)
tree7e612837ec42c01b06904933ecde68c78779eca0
parent36e8932c2d3d42f7651ab6aae7af62175ba172e1 (diff)
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