summaryrefslogtreecommitdiff
path: root/t/t7406-submodule-update.sh
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-08-10 17:56:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-10 18:27:22 (GMT)
commit967d7f898c30bad41824c3f77962266b7cd7be32 (patch)
tree89d385c2575fb6d16936744b81488547ada91d9c /t/t7406-submodule-update.sh
parent4d7bc52b178bffe9e484c4dcd92d5353e2ce716f (diff)
downloadgit-967d7f898c30bad41824c3f77962266b7cd7be32.zip
git-967d7f898c30bad41824c3f77962266b7cd7be32.tar.gz
git-967d7f898c30bad41824c3f77962266b7cd7be32.tar.bz2
t7406: fix breakage on OSX
On OSX `wc` prefixes the output of numbers with whitespace, such that the `commit_count` would be "SP <NUMBER>". When using that in git submodule update --init --depth=$commit_count the depth would be empty and the number is interpreted as the pathspec. Fix this by not using `wc` and rather instruct rev-list to count. Another way to fix this is to remove the `=` sign after the `--depth` argument as then we are allowed to have more than just one whitespace between `--depth` and the actual number. Prefer the solution of rev-list counting as that is expected to be slightly faster and more self-contained within Git. Reported-by: Lars Schneider <larsxschneider@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com>, Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-xt/t7406-submodule-update.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index d7983cf..64f322c 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -877,7 +877,7 @@ test_expect_success 'submodule update clone shallow submodule' '
test_when_finished "rm -rf super3" &&
first=$(git -C cloned submodule status submodule |cut -c2-41) &&
second=$(git -C submodule rev-parse HEAD) &&
- commit_count=$(git -C submodule rev-list $first^..$second | wc -l) &&
+ commit_count=$(git -C submodule rev-list --count $first^..$second) &&
git clone cloned super3 &&
pwd=$(pwd) &&
(