Skip to content

Commit

Permalink
t2025: add a test to make sure grafts is working from a linked checkout
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Dec 1, 2014
1 parent 3473ad0 commit ad35f61
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions t/t2025-checkout-to.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ad35f61

Please sign in to comment.