Count merge commits in git when checking differences with tracking remote branch
This commit is contained in:
parent
0e0cc870c2
commit
7e7734e624
10
liquidprompt
10
liquidprompt
@ -762,14 +762,12 @@ _lp_git_branch_color()
|
|||||||
|
|
||||||
local -i has_commit
|
local -i has_commit
|
||||||
has_commit=0
|
has_commit=0
|
||||||
if [[ -n "$remote" ]] ; then
|
if [[ -n "$remote" ]]; then
|
||||||
local remote_branch
|
local remote_branch
|
||||||
remote_branch="$(\git config --get branch.${branch}.merge)"
|
remote_branch="$(\git config --get branch.${branch}.merge)"
|
||||||
if [[ -n "$remote_branch" ]] ; then
|
if [[ -n "$remote_branch" ]]; then
|
||||||
has_commit="$(\git rev-list --no-merges --count ${remote_branch/refs\/heads/refs\/remotes\/$remote}..HEAD 2>/dev/null)"
|
has_commit="$(\git rev-list --count ${remote_branch/refs\/heads/refs\/remotes\/$remote}..HEAD 2>/dev/null)"
|
||||||
if [[ -z "$has_commit" ]] ; then
|
[[ -z "$has_commit" ]] && has_commit=0
|
||||||
has_commit=0
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user