aboutsummaryrefslogtreecommitdiffstats
path: root/t/t6000-rev-list-misc.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6000-rev-list-misc.sh')
-rwxr-xr-xt/t6000-rev-list-misc.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 6289a2e8b0..886e2fc710 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -182,4 +182,39 @@ test_expect_success 'rev-list --unpacked' '
test_cmp expect actual
'
+test_expect_success 'rev-list -z' '
+ test_when_finished rm -rf repo &&
+
+ git init repo &&
+ test_commit -C repo 1 &&
+ test_commit -C repo 2 &&
+
+ oid1=$(git -C repo rev-parse HEAD~) &&
+ oid2=$(git -C repo rev-parse HEAD) &&
+
+ printf "%s\0%s\0" "$oid2" "$oid1" >expect &&
+ git -C repo rev-list -z HEAD >actual &&
+
+ test_cmp expect actual
+'
+
+test_expect_success 'rev-list -z --objects' '
+ test_when_finished rm -rf repo &&
+
+ git init repo &&
+ test_commit -C repo 1 &&
+ test_commit -C repo 2 &&
+
+ oid1=$(git -C repo rev-parse HEAD:1.t) &&
+ oid2=$(git -C repo rev-parse HEAD:2.t) &&
+ path1=1.t &&
+ path2=2.t &&
+
+ printf "%s\0path=%s\0%s\0path=%s\0" "$oid1" "$path1" "$oid2" "$path2" \
+ >expect &&
+ git -C repo rev-list -z --objects HEAD:1.t HEAD:2.t >actual &&
+
+ test_cmp expect actual
+'
+
test_done