t: add a test for shell characters in paths

Now that we've included gitobj v1.4.1, add a test for the failure case
we had in the past to prevent us from regressing this behavior.  Check
that shell characters within a pathname don't cause a failure when we
open the pack file.  Choose brackets since these are available on all
platforms, including Windows.
This commit is contained in:
brian m. carlson 2019-09-10 18:20:39 +00:00
parent f65985a1c9
commit c384de075c
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1

@ -98,6 +98,30 @@ begin_test "fsck dry run"
)
end_test
begin_test "fsck does not fail with shell characters in paths"
(
set -e
mkdir '[[path]]'
cd '[[path]]'
reponame="fsck-shell-paths"
git init $reponame
cd $reponame
# Create a commit with some files tracked by git-lfs
git lfs track *.dat
echo "test data" > a.dat
echo "test data 2" > b.dat
git add .gitattributes *.dat
git commit -m "first commit"
# Verify that the pack code handles glob patterns properly.
git gc --aggressive --prune=now
[ "Git LFS fsck OK" = "$(git lfs fsck)" ]
)
end_test
begin_test "fsck: outside git repository"
(
set +e