git-lfs/test/test-init.sh

55 lines
1.1 KiB
Bash
Raw Normal View History

2015-06-28 12:48:59 +00:00
#!/bin/sh
. "test/testlib.sh"
begin_test "init again"
(
set -e
tmphome="$(basename "$0" ".sh")"
mkdir -p $tmphome
cp $HOME/.gitconfig $tmphome/
HOME=$PWD/$tmphome
cd $HOME
2015-06-28 12:48:59 +00:00
[ "git-lfs smudge %f" = "$(git config filter.lfs.smudge)" ]
[ "git-lfs clean %f" = "$(git config filter.lfs.clean)" ]
git lfs init
[ "git-lfs smudge %f" = "$(git config filter.lfs.smudge)" ]
[ "git-lfs clean %f" = "$(git config filter.lfs.clean)" ]
)
end_test
begin_test "init with old settings"
(
set -e
tmphome="$(basename "$0" ".sh")"
mkdir -p $tmphome
HOME=$PWD/$tmphome
cd $HOME
2015-06-28 12:48:59 +00:00
git config --global filter.lfs.smudge "git lfs smudge %f"
git config --global filter.lfs.clean "git lfs clean %f"
2015-07-06 23:12:31 +00:00
set +e
2015-06-28 12:48:59 +00:00
git lfs init 2> init.log
2015-07-06 23:12:31 +00:00
res=$?
set -e
[ "$res" = 2 ]
2015-06-28 12:48:59 +00:00
grep "clean filter should be" init.log
2015-07-07 14:43:59 +00:00
[ `grep -c "(MISSING)" init.log` = "0" ]
2015-06-28 12:48:59 +00:00
[ "git lfs smudge %f" = "$(git config filter.lfs.smudge)" ]
[ "git lfs clean %f" = "$(git config filter.lfs.clean)" ]
2015-07-06 23:12:31 +00:00
git lfs init --force
[ "git-lfs smudge %f" = "$(git config filter.lfs.smudge)" ]
[ "git-lfs clean %f" = "$(git config filter.lfs.clean)" ]
2015-06-28 12:48:59 +00:00
)
end_test