summaryrefslogtreecommitdiff
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.sh29
1 files changed, 24 insertions, 5 deletions
diff --git a/t/t6000-rev-list-misc.sh b/t/t6000-rev-list-misc.sh
index 3dc1ad8..6289a2e 100755
--- a/t/t6000-rev-list-misc.sh
+++ b/t/t6000-rev-list-misc.sh
@@ -2,12 +2,16 @@
test_description='miscellaneous rev-list tests'
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
. ./test-lib.sh
test_expect_success setup '
echo content1 >wanted_file &&
echo content2 >unwanted_file &&
git add wanted_file unwanted_file &&
+ test_tick &&
git commit -m one
'
@@ -21,6 +25,7 @@ test_expect_success 'rev-list --objects with pathspecs and deeper paths' '
mkdir foo &&
>foo/file &&
git add foo/file &&
+ test_tick &&
git commit -m two &&
git rev-list --objects HEAD -- foo >output &&
@@ -69,6 +74,7 @@ test_expect_success '--no-object-names and --object-names are last-one-wins' '
'
test_expect_success 'rev-list A..B and rev-list ^A B are the same' '
+ test_tick &&
git commit --allow-empty -m another &&
git tag -a -m "annotated" v1.0 &&
git rev-list --objects ^v1.0^ v1.0 >expect &&
@@ -82,12 +88,12 @@ test_expect_success 'propagate uninteresting flag down correctly' '
'
test_expect_success 'symleft flag bit is propagated down from tag' '
- git log --format="%m %s" --left-right v1.0...master >actual &&
+ git log --format="%m %s" --left-right v1.0...main >actual &&
cat >expect <<-\EOF &&
- > two
- > one
< another
< that
+ > two
+ > one
EOF
test_cmp expect actual
'
@@ -125,8 +131,8 @@ test_expect_success 'rev-list can negate index objects' '
test_cmp expect actual
'
-test_expect_success '--bisect and --first-parent can not be combined' '
- test_must_fail git rev-list --bisect --first-parent HEAD
+test_expect_success '--bisect and --first-parent can be combined' '
+ git rev-list --bisect --first-parent HEAD
'
test_expect_success '--header shows a NUL after each commit' '
@@ -163,4 +169,17 @@ test_expect_success 'rev-list --count --objects' '
test_line_count = $count actual
'
+test_expect_success 'rev-list --unpacked' '
+ git repack -ad &&
+ test_commit unpacked &&
+
+ git rev-list --objects --no-object-names unpacked^.. >expect.raw &&
+ sort expect.raw >expect &&
+
+ git rev-list --all --objects --unpacked --no-object-names >actual.raw &&
+ sort actual.raw >actual &&
+
+ test_cmp expect actual
+'
+
test_done