Permalink
Browse files

fix sync saying that branch is in the past

  • Loading branch information...
orefalo committed Mar 6, 2013
1 parent b696b02 commit 3080e0632a5c8baf9068eace1abc0e9e45178e36
Showing with 3 additions and 3 deletions.
  1. +3 −3 cmds/g2-g2isbehind.sh
View
@@ -1,13 +1,13 @@
#!/bin/bash
#
-# Returns 1 if the branch is behind its upstream branch, 0 if not
+# Returns 0 if the branch is behind its upstream branch, 1 if not
local=$("$GIT_EXE" branch | grep "*" | sed "s/* //")
remote=$1
[[ -z $1 ]] && remote=$("$GIT_EXE" g2getremote)
[[ -n $remote ]] && {
"$GIT_EXE" fetch
RIGHT_AHEAD=$("$GIT_EXE" rev-list --left-right ${local}...${remote} -- 2> /dev/null | grep -c "^>")
- [[ $RIGHT_AHEAD -gt 0 ]] && exit 1;
+ [[ $RIGHT_AHEAD -gt 0 ]] && exit 0;
}
-exit 0;
+exit 1;

0 comments on commit 3080e06

Please sign in to comment.