git-lfs/test/test-push.sh
2015-05-27 14:18:02 -06:00

56 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
. "test/testlib.sh"
begin_test "push"
(
set -e
reponame="$(basename "$0" ".sh")"
setup_remote_repo "$reponame"
clone_repo "$reponame" repo
git lfs track "*.dat"
echo "push a" > a.dat
git add .gitattributes a.dat
git commit -m "add a.dat"
git lfs push origin master 2>&1 | tee push.log
grep "(1 of 1 files)" push.log
git checkout -b push-b
echo "push b" > b.dat
git add b.dat
git commit -m "add b.dat"
git lfs push origin push-b 2>&1 | tee push.log
grep "(2 of 2 files)" push.log
)
end_test
begin_test "push dry-run"
(
set -e
reponame="$(basename "$0" ".sh")-dry-run"
setup_remote_repo "$reponame"
clone_repo "$reponame" repo-dry-run
git lfs track "*.dat"
echo "push a" > a.dat
git add .gitattributes a.dat
git commit -m "add a.dat"
[ "push a.dat" = "$(git lfs push --dry-run origin master 2>&1)" ]
git checkout -b push-b
echo "push b" > b.dat
git add b.dat
git commit -m "add b.dat"
git lfs push --dry-run origin push-b 2>&1 | tee push.log
grep "push a.dat" push.log
grep "push b.dat" push.log
)
end_test