projects
/
~madcoder
/
dotfiles.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
claws fix
[~madcoder/dotfiles.git]
/
+bin
/
git-up
diff --git
a/+bin/git-up
b/+bin/git-up
index
da40169
..
35e0e9d
100755
(executable)
--- a/
+bin/git-up
+++ b/
+bin/git-up
@@
-69,16
+69,20
@@
if test -z "$action"; then
esac
fi
esac
fi
+no_changes () {
+ git diff-index --quiet --cached HEAD --ignore-submodules -- &&
+ git diff-files --quiet --ignore-submodules
+}
+
unclean=
unclean=
-git rev-parse --verify HEAD > /dev/null && \
- git update-index --refresh && \
- git diff-files --quiet && \
- git diff-index --cached --quiet HEAD -- || unclean=t
+no_changes || unclean=t
+
case "$action" in
rebase)
test -z "$unclean" || git stash save "git-up stash"
git rebase "${remote}/${branch#refs/heads/}"
case "$action" in
rebase)
test -z "$unclean" || git stash save "git-up stash"
git rebase "${remote}/${branch#refs/heads/}"
+ cd "$(dirname "$(git rev-parse --git-dir)")" && git submodule update --rebase
;;
merge)
test -z "$unclean" || git stash save "git-up stash"
;;
merge)
test -z "$unclean" || git stash save "git-up stash"
@@
-95,6
+99,6
@@
if test -n "$unclean"; then
echo ""
echo "run 'git stash apply' when rebase is finished"
else
echo ""
echo "run 'git stash apply' when rebase is finished"
else
- git stash
apply
+ git stash
pop
fi
fi
fi
fi