git-lfs/t/t-install-worktree-unsupported.sh
Chris Darroch f930c259aa t: add tests for --worktree install and uninstall
We add a number of tests, conditional on the Git version, to
validate the functionality of the --worktree option when
installing or uninstalling.

Note that because this simply passed through to the "git config"
command, we inherit the behaviour that --worktree functions
like --local when only a single, default working tree is in use.

And if we have a Git version older than 2.20.0, we confirm that
the --worktree option is not supported.
2020-06-26 14:56:06 -07:00

30 lines
611 B
Bash
Executable File

#!/usr/bin/env bash
. "$(dirname "$0")/testlib.sh"
# These tests rely on behavior found in Git versions less than 2.20.0 to
# perform themselves, specifically:
# - lack of worktreeConfig extension support
ensure_git_version_isnt $VERSION_HIGHER "2.20.0"
begin_test "install --worktree with unsupported worktreeConfig extension"
(
set -e
reponame="$(basename "$0" ".sh")-unsupported"
mkdir "$reponame"
cd "$reponame"
git init
set +e
git lfs install --worktree 2>err.log
res=$?
set -e
cat err.log
grep -i "error" err.log
grep -- "--worktree" err.log
[ "0" != "$res" ]
)
end_test