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>
Nguyễn Thái Ngọc Duy committed
Nov 30, 2014 at 15:24 UTC
ad35f61518f93cb13ff79d1c85d3e04d03097bf3
1 file changed
+18
t/t2025-checkout-to.sh
+18
@@ -96,4 +96,22 @@ test_expect_success 'checkout from a bare repo without --to' '
96
)
97
'
98
99
+test_expect_success 'checkout with grafts' '
100
+ test_when_finished rm .git/info/grafts &&
101
+ test_commit abc &&
102
+ SHA1=`git rev-parse HEAD` &&
103
+ test_commit def &&
104
+ test_commit xyz &&
105
+ echo "`git rev-parse HEAD` $SHA1" >.git/info/grafts &&
106
+ cat >expected <<-\EOF &&
107
+ xyz
108
+ abc
109
+ EOF
110
+ git log --format=%s -2 >actual &&
111
+ test_cmp expected actual &&
112
+ git checkout --detach --to grafted master &&
113
+ git --git-dir=grafted/.git log --format=%s -2 >actual &&
114
+ test_cmp expected actual
115
+'
116
+
117
test_done