test/test-track: move to version specific test

This commit is contained in:
Taylor Blau 2017-04-25 13:47:58 -06:00
parent 5af2ba3cc9
commit 508d6764a8
2 changed files with 37 additions and 31 deletions

37
test/test-track-attrs.sh Executable file

@ -0,0 +1,37 @@
#!/usr/bin/env bash
. "test/testlib.sh"
ensure_git_version_isnt $VERSION_LOWER "1.9.0"
begin_test "track (--no-modify-attrs)"
(
set -e
reponame="track-no-modify-attrs"
git init "$reponame"
cd "$reponame"
echo "contents" > a.dat
git add a.dat
# Git assumes that identical results from `stat(1)` between the index and
# working copy are stat dirty. To prevent this, wait at least one second to
# yield different `stat(1)` results.
sleep 1
git commit -m "add a.dat"
echo "*.dat filter=lfs diff=lfs merge=lfs -text" > .gitattributes
git add .gitattributes
git commit -m "asdf"
[ -z "$(git status --porcelain)" ]
git lfs track --no-modify-attrs "*.dat"
[ " M a.dat" = "$(git status --porcelain)" ]
)
end_test

@ -463,34 +463,3 @@ begin_test "track escaped pattern"
assert_attributes_count "\\#" "filter=lfs" 1
)
end_test
begin_test "track (--no-modify-attrs)"
(
set -e
reponame="track-no-modify-attrs"
git init "$reponame"
cd "$reponame"
echo "contents" > a.dat
git add a.dat
# Git assumes that identical results from `stat(1)` between the index and
# working copy are stat dirty. To prevent this, wait at least one second to
# yield different `stat(1)` results.
sleep 1
git commit -m "add a.dat"
echo "*.dat filter=lfs diff=lfs merge=lfs -text" > .gitattributes
git add .gitattributes
git commit -m "asdf"
[ -z "$(git status --porcelain)" ]
git lfs track --no-modify-attrs "*.dat"
[ " M a.dat" = "$(git status --porcelain)" ]
)
end_test