Kaydet (Commit) ae6d4aeb authored tarafından Miklos Vajna's avatar Miklos Vajna

g push/status: use @{upstream} instead of origin

origin won't work if origin/HEAD points to nowhere, which is a valid
use-case.
üst 1613a494
...@@ -321,11 +321,11 @@ for REPO in $DIRS ; do ...@@ -321,11 +321,11 @@ for REPO in $DIRS ; do
;; ;;
push) push)
if [ "$PUSH_ALL" != "1" ] ; then if [ "$PUSH_ALL" != "1" ] ; then
[ -n "$(git rev-list origin..HEAD)" ] || exit 0 [ -n "$(git rev-list @{upstream}..HEAD)" ] || exit 0
fi fi
;; ;;
status) status)
LOCALCOMMITS="$(git rev-list origin..HEAD)" LOCALCOMMITS="$(git rev-list @{upstream}..HEAD)"
if [ -z "$LOCALCOMMITS" ] ; then if [ -z "$LOCALCOMMITS" ] ; then
[ -z "$(git diff-index --name-only HEAD --)" ] && exit 0 [ -z "$(git diff-index --name-only HEAD --)" ] && exit 0
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment