9e006ac4e2
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'
52 lines
1009 B
Bash
Executable File
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
|