Skip to content

Commit ad35f61

Browse files
pcloudsgitster
authored andcommitted
t2025: add a test to make sure grafts is working from a linked checkout
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3473ad0 commit ad35f61

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

t/t2025-checkout-to.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,22 @@ test_expect_success 'checkout from a bare repo without --to' '
9696
)
9797
'
9898

99+
test_expect_success 'checkout with grafts' '
100+
test_when_finished rm .git/info/grafts &&
101+
test_commit abc &&
102+
SHA1=`git rev-parse HEAD` &&
103+
test_commit def &&
104+
test_commit xyz &&
105+
echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
106+
cat >expected <<-\EOF &&
107+
xyz
108+
abc
109+
EOF
110+
git log --format=%s -2 >actual &&
111+
test_cmp expected actual &&
112+
git checkout --detach --to grafted master &&
113+
git --git-dir=grafted/.git log --format=%s -2 >actual &&
114+
test_cmp expected actual
115+
'
116+
99117
test_done

0 commit comments

Comments
 (0)