git-lfs/t/t-mergetool.sh
brian m. carlson 9e006ac4e2
Rename default branch in tests to "main"
Currently, our default branch in tests is "master".  This is the Git
default, but the Git default will likely change in the future, so it
makes sense to update our testsuite to be explicit about the branch
name.  We'll ensure this continues by building against older versions of
Git as well as newer versions.

We use "main" for the new branch name, since that's the proposed value
upstream.

This commit was made entirely by automated means using the following
command:

  git grep -l master t | xargs sed -i -e 's/master/main/g'
2020-07-08 15:38:17 +00:00

52 lines
1009 B
Bash
Executable File

#!/usr/bin/env bash
. "$(dirname "$0")/testlib.sh"
begin_test "mergetool works with large files"
(
set -e
reponame="mergetool-works-with-large-files"
git init "$reponame"
cd "$reponame"
git lfs track "*.dat"
printf "base" > conflict.dat
git add .gitattributes conflict.dat
git commit -m "initial commit"
git checkout -b conflict
printf "b" > conflict.dat
git add conflict.dat
git commit -m "conflict.dat: b"
git checkout main
printf "a" > conflict.dat
git add conflict.dat
git commit -m "conflict.dat: a"
set +e
git merge conflict
set -e
git config mergetool.inspect.cmd '
for i in BASE LOCAL REMOTE; do
echo "\$$i=$(eval "cat \"\$$i\"")";
done;
exit 1
'
git config mergetool.inspect.trustExitCode true
yes | git mergetool \
--no-prompt \
--tool=inspect \
-- conflict.dat 2>&1 \
| tee mergetool.log
grep "\$BASE=base" mergetool.log
grep "\$LOCAL=a" mergetool.log
grep "\$REMOTE=b" mergetool.log
)
end_test