aboutsummaryrefslogtreecommitdiff
path: root/commit
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-05-14 14:26:09 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-05-14 14:26:09 -0300
commitc31d9f1126dd87fefc5d36673a03ddfa753bf2b4 (patch)
treef34baceae0554004ba8200d7e6073e3e48c3ada1 /commit
parentfc6d705e67aaf7489c3465d7cab85dd57b81b0f7 (diff)
downloadutils-git-c31d9f1126dd87fefc5d36673a03ddfa753bf2b4.tar.gz
utils-git-c31d9f1126dd87fefc5d36673a03ddfa753bf2b4.tar.bz2
Auto fetch changes on commit, fix staging check
Diffstat (limited to 'commit')
-rwxr-xr-xcommit3
1 files changed, 3 insertions, 0 deletions
diff --git a/commit b/commit
index ccf03f6..e7026b6 100755
--- a/commit
+++ b/commit
@@ -131,6 +131,8 @@ function git_commit {
# If there are no staged files, commit everything.
# Otherwise commit just what was staged
if git status --short | grep -q "^[AM]"; then
+ flag=""
+ else
flag="-a"
fi
@@ -148,5 +150,6 @@ if [ ! -z "$1" ]; then
git_user
git_commit $*
git_push
+ git fetch --all
fi
fi