projects
/
~madcoder
/
dotfiles.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
removed files
[~madcoder/dotfiles.git]
/
+bin
/
git-up
diff --git
a/+bin/git-up
b/+bin/git-up
index
d9fc1cd
..
c0172a2
100755
(executable)
--- a/
+bin/git-up
+++ b/
+bin/git-up
@@
-1,5
+1,7
@@
#!/bin/sh
#!/bin/sh
+. "$(dirname "$0")/setup.sh"
+
OPTIONS_SPEC="\
$(basename $0) [options] [<remote> [<branch>]]
--
OPTIONS_SPEC="\
$(basename $0) [options] [<remote> [<branch>]]
--
@@
-52,7
+54,10
@@
case $# in
*) usage;;
esac
*) usage;;
esac
-git fetch "${remote}"
+git remote update
+if git config remote.mob.fetch >/dev/null 2>/dev/null; then
+ git remote prune mob
+fi
if test `git rev-list .."${remote}/${branch#refs/heads/}" -- | wc -l` = 0; then
echo "Current branch $lbranch is up to date."
exit 0
if test `git rev-list .."${remote}/${branch#refs/heads/}" -- | wc -l` = 0; then
echo "Current branch $lbranch is up to date."
exit 0
@@
-69,11
+74,14
@@
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)
case "$action" in
rebase)
@@
-96,6
+104,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