f930c259aa
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.
29 lines
604 B
Bash
Executable File
29 lines
604 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 "uninstall --worktree with unsupported worktreeConfig extension"
|
|
(
|
|
set -e
|
|
|
|
reponame="$(basename "$0" ".sh")-unsupported"
|
|
mkdir "$reponame"
|
|
cd "$reponame"
|
|
|
|
set +e
|
|
git lfs uninstall --worktree 2>err.log
|
|
res=$?
|
|
set -e
|
|
|
|
cat err.log
|
|
grep -i "error" err.log
|
|
grep -- "--worktree" err.log
|
|
[ "0" != "$res" ]
|
|
)
|
|
end_test
|