From: Nguyễn Thái Ngọc Duy Date: Sat, 30 Aug 2014 08:34:02 GMT Subject: [PATCH 32/32] t2025: add a test to make sure grafts is working from a linked checkout Message-ID: <1409387642-24492-33-git-send-email-pclouds@gmail.com> In-Reply-To: <1409387642-24492-1-git-send-email-pclouds@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t2025-checkout-to.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh index 9f701a1..aa24ea8 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 -- 2.1.0.rc0.78.gc0d8480