mirror of
https://github.com/git/git.git
synced 2024-11-25 02:44:48 +08:00
t2025: add a test to make sure grafts is working from a linked checkout
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3473ad0cf6
commit
ad35f61518
@ -96,4 +96,22 @@ test_expect_success 'checkout from a bare repo without --to' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_success 'checkout with grafts' '
|
||||
test_when_finished rm .git/info/grafts &&
|
||||
test_commit abc &&
|
||||
SHA1=`git rev-parse HEAD` &&
|
||||
test_commit def &&
|
||||
test_commit xyz &&
|
||||
echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
|
||||
cat >expected <<-\EOF &&
|
||||
xyz
|
||||
abc
|
||||
EOF
|
||||
git log --format=%s -2 >actual &&
|
||||
test_cmp expected actual &&
|
||||
git checkout --detach --to grafted master &&
|
||||
git --git-dir=grafted/.git log --format=%s -2 >actual &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Loading…
Reference in New Issue
Block a user