git-lfs/t/t-filter-branch.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

42 lines
932 B
Bash
Executable File

#!/usr/bin/env bash
. "$(dirname "$0")/testlib.sh"
begin_test "filter-branch (git-lfs/git-lfs#1773)"
(
set -e
reponame="filter-branch"
setup_remote_repo "$reponame"
clone_repo "$reponame" "$reponame"
contents_a="contents (a)"
printf "%s" "$contents_a" > a.dat
git add a.dat
git commit -m "add a.dat"
contents_b="contents (b)"
printf "%s" "$contents_b" > b.dat
git add b.dat
git commit -m "add b.dat"
contents_c="contents (c)"
printf "%s" "$contents_c" > c.dat
git add c.dat
git commit -m "add c.dat"
git filter-branch -f --prune-empty \
--tree-filter '
echo >&2 "---"
git rm --cached -r -q .
git lfs track "*.dat"
git add .
' --tag-name-filter cat -- --all
assert_pointer "main" "a.dat" "$(calc_oid "$contents_a")" 12
assert_pointer "main" "b.dat" "$(calc_oid "$contents_b")" 12
assert_pointer "main" "c.dat" "$(calc_oid "$contents_c")" 12
)
end_test