From d1d362fb8cf03263d259d91215b841c4aea2ac50 Mon Sep 17 00:00:00 2001 From: Michael Allen Date: Mon, 2 Mar 2015 00:42:42 +0000 Subject: speed up remote_behind/ahead by not checking if tracking = remote --- test-commits.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test-commits.sh') 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 -- cgit v1.2.3