Skip to content

Commit 02eb819

Browse files
committed
Add test for importing patch with ".." in name
Signed-off-by: Peter Grayson <[email protected]>
1 parent 6a948ca commit 02eb819

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

t/t1800-import.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ test_expect_success \
3838
stg pop &&
3939
stg import "$TEST_DIRECTORY"/t1800/git-diff &&
4040
test "$(echo $(stg series --noprefix))" = "git-diff-1 git-diff" &&
41-
stg delete ..
41+
stg delete git-diff git-diff-1
4242
'
4343

4444
test_expect_success \
@@ -71,6 +71,18 @@ test_expect_success \
7171
stg delete ..
7272
'
7373

74+
test_expect_success \
75+
'Apply a patch with ".." in filename' \
76+
'
77+
cp "$TEST_DIRECTORY"/t1800/git-diff git..diff &&
78+
test_when_finished rm git..diff &&
79+
stg import -p1 git..diff &&
80+
test "$(echo $(stg series --noprefix))" = "git.diff" &&
81+
[ $(git cat-file -p $(stg id) \
82+
| grep -c "tree e96b1fba2160890ff600b675d7140d46b022b155") = 1 ] &&
83+
stg delete ..
84+
'
85+
7486
test_expect_success \
7587
'Apply a patch created with "git diff" using -p0' \
7688
'

0 commit comments

Comments
 (0)