Skip to content

Commit

Permalink
test: Test stg import --directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jpgrayson committed Dec 12, 2022
1 parent ad4e0dd commit 20b85b3
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions t/t1800-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ test_expect_success 'Import empty patch with sign-off' '
stg top | grep -v -e "empty"
'

test_expect_success 'Import with root directory' '
mkdir -p dir0/dir1/dir2 &&
echo "hello" >dir0/dir1/dir2/file.txt &&
stg add dir0/dir1/dir2/file.txt &&
stg new -rm "dirs" &&
echo "bye" >>dir0/dir1/dir2/file.txt &&
git diff --relative=dir0/dir1 >relative.diff &&
stg reset --hard &&
command_error stg import --directory=dir0/dir1/dir2 <relative.diff 2>err &&
grep "error: dir0/dir1/dir2/dir2/file.txt: does not exist in index" err &&
stg import --name from-relative --3way --directory=dir0/dir1 <relative.diff &&
stg show from-relative | grep "bye" &&
stg delete dirs from-relative
'

test_expect_success 'Import series from stdin' '
echo "some.patch" |
stg import --series &&
Expand Down

0 comments on commit 20b85b3

Please sign in to comment.