summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 08:24:57 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-01 19:00:19 (GMT)
commitad35f61518f93cb13ff79d1c85d3e04d03097bf3 (patch)
tree7015e857f7b336e9f4e70ce8efc20559bcc6e5ea /t
parent3473ad0cf6c90917813aba978dada6c10352baaa (diff)
downloadgit-ad35f61518f93cb13ff79d1c85d3e04d03097bf3.zip
git-ad35f61518f93cb13ff79d1c85d3e04d03097bf3.tar.gz
git-ad35f61518f93cb13ff79d1c85d3e04d03097bf3.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t2025-checkout-to.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh
index 4bd1df4..eddd325 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