| 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | . "$(dirname "$0")/testlib.sh" |
| 4 | |
| 5 | begin_test "repository format version" |
| 6 | ( |
| 7 | set -e |
| 8 | |
| 9 | reponame="lfs-repo-version" |
| 10 | git init $reponame |
| 11 | cd $reponame |
| 12 | |
| 13 | [ -z "$(git config --local lfs.repositoryFormatVersion)" ] |
| 14 | |
| 15 | git lfs track '*.dat' |
| 16 | |
| 17 | [ "$(git config --local lfs.repositoryFormatVersion)" = "0" ] |
| 18 | |
| 19 | git config --local lfs.repositoryFormatVersion 1 |
| 20 | |
| 21 | git lfs track '*.bin' >output 2>&1 && exit 1 |
| 22 | cat output |
| 23 | grep "Unknown repository format version: 1" output |
| 24 | |
| 25 | git config --local --unset lfs.repositoryFormatVersion |
| 26 | # Verify that global settings are ignored. |
| 27 | git config --global lfs.repositoryFormatVersion 1 |
| 28 | |
| 29 | git lfs track '*.bin' |
| 30 | ) |
| 31 | end_test |