From: Nguyễn Thái Ngọc Duy Date: Sun, 30 Nov 2014 08:24:57 +0000 (+0700) Subject: t2025: add a test to make sure grafts is working from a linked checkout X-Git-Tag: v2.5.0-rc0~143^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad35f61518f93cb13ff79d1c85d3e04d03097bf3;p=git t2025: add a test to make sure grafts is working from a linked checkout Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh index 4bd1df4899..eddd3251f1 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -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