summaryrefslogtreecommitdiffstats
path: root/git-base.sh
diff options
context:
space:
mode:
authorMichael Allen <michael@michaelallen.io>2015-03-01 21:14:00 +0000
committerMichael Allen <michael@michaelallen.io>2015-03-01 21:14:00 +0000
commit51e4515659671f882eb0446fa1e9e8f87b784866 (patch)
treeb998d206fcdbe1f2fdbcada2df983b25197a781d /git-base.sh
parent6001be4d3ae315eb5f6974ee68c488dc7df0c19c (diff)
downloadgit-sonar-51e4515659671f882eb0446fa1e9e8f87b784866.tar.gz
git-sonar-51e4515659671f882eb0446fa1e9e8f87b784866.zip
provide a default for remote_branch_name so we can be faster
Diffstat (limited to 'git-base.sh')
-rwxr-xr-xgit-base.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/git-base.sh b/git-base.sh
index 7ffb511..a4680c6 100755
--- a/git-base.sh
+++ b/git-base.sh
@@ -140,7 +140,7 @@ remote_branch_name() {
}
commits_behind_of_remote() {
- remote_branch="$(remote_branch_name)"
+ remote_branch=${1:-"$(remote_branch_name)"}
if [[ -n "$remote_branch" ]]; then
set --
set -- $(git rev-list --left-right --count ${remote_branch}...HEAD)
@@ -154,7 +154,7 @@ commits_behind_of_remote() {
}
commits_ahead_of_remote() {
- remote_branch="$(remote_branch_name)"
+ remote_branch=${1:-"$(remote_branch_name)"}
if [[ -n "$remote_branch" ]]; then
set --
set -- $(git rev-list --left-right --count ${remote_branch}...HEAD)
@@ -168,7 +168,7 @@ commits_ahead_of_remote() {
}
remote_behind_of_master() {
- remote_branch="$(remote_branch_name)"
+ remote_branch=${1:-"$(remote_branch_name)"}
if [[ -n "$remote_branch" ]]; then
set --
set -- $(git rev-list --left-right --count origin/master...${remote_branch})
@@ -182,7 +182,7 @@ remote_behind_of_master() {
}
remote_ahead_of_master() {
- remote_branch="$(remote_branch_name)"
+ remote_branch=${1:-"$(remote_branch_name)"}
if [[ -n "$remote_branch" ]]; then
set --
set -- $(git rev-list --left-right --count origin/master...${remote_branch})