Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a2e5c1713c
Fetching contributors…

Cannot retrieve contributors at this time

executable file 14 lines (12 sloc) 0.399 kb
#!/bin/bash
#
# Returns true if the branch is behind its upstream branch
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 ]] && echo "true" && exit
}
echo "false"
Jump to Line
Something went wrong with that request. Please try again.