diff options
author | Michael Allen <michael@michaelallen.io> | 2015-03-02 00:42:42 +0000 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-03-02 00:42:42 +0000 |
commit | d1d362fb8cf03263d259d91215b841c4aea2ac50 (patch) | |
tree | 23bf7582a0ea8b7c98fe817d4affbada51a7c47e /test-commits.sh | |
parent | 921c0d804fd235ef19c3b191696425d7b55738e4 (diff) | |
download | git-sonar-d1d362fb8cf03263d259d91215b841c4aea2ac50.tar.gz git-sonar-d1d362fb8cf03263d259d91215b841c4aea2ac50.zip |
speed up remote_behind/ahead by not checking if tracking = remote
Diffstat (limited to 'test-commits.sh')
-rwxr-xr-x | test-commits.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test-commits.sh b/test-commits.sh index e3c945b..e1800aa 100755 --- a/test-commits.sh +++ b/test-commits.sh @@ -234,4 +234,29 @@ test_dont_call_remote_branch_name() { rm_tmp } +test_dont_remote_if_remote_is_master() { + cd_to_tmp + git init --quiet + + remote_branch="origin/master" + + debug_output="$( + { + set -x + output="$( + remote_behind_of_master "$remote_branch"; + remote_ahead_of_master "$remote_branch"; + )" + set +x + } 2>&1 + echo "$output" + )" + + usages="$(echo "$debug_output" | grep 'git rev-list' | wc -l )" + + assertEquals " 0" "$usages" + + rm_tmp +} + . ./shunit/shunit2 |