aboutsummaryrefslogtreecommitdiffstats
path: root/t/t6013-rev-list-reverse-parents.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6013-rev-list-reverse-parents.sh')
-rwxr-xr-xt/t6013-rev-list-reverse-parents.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/t6013-rev-list-reverse-parents.sh b/t/t6013-rev-list-reverse-parents.sh
index 39793cbbd6..273196f52b 100755
--- a/t/t6013-rev-list-reverse-parents.sh
+++ b/t/t6013-rev-list-reverse-parents.sh
@@ -26,17 +26,19 @@ test_expect_success 'set up --reverse example' '
commit five
'
+reverse () {
+ awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }'
+}
+
test_expect_success '--reverse --parents --full-history combines correctly' '
- git rev-list --parents --full-history main -- foo |
- perl -e "print reverse <>" > expected &&
+ git rev-list --parents --full-history main -- foo | reverse >expected &&
git rev-list --reverse --parents --full-history main -- foo \
> actual &&
test_cmp expected actual
'
test_expect_success '--boundary does too' '
- git rev-list --boundary --parents --full-history main ^root -- foo |
- perl -e "print reverse <>" > expected &&
+ git rev-list --boundary --parents --full-history main ^root -- foo | reverse >expected &&
git rev-list --boundary --reverse --parents --full-history \
main ^root -- foo > actual &&
test_cmp expected actual