commands: fix issues based on feedback
* Exit `migrate import --no-rewrite` if attributes filter has no elements in its Include() list * In `--no-rewrite` tests checking errors, fail out of test if the command doesn't fail
This commit is contained in:
parent
77ebf9b144
commit
30cdf66a21
@ -49,7 +49,7 @@ func migrateImportCommand(cmd *cobra.Command, args []string) {
|
||||
root := commit.TreeID
|
||||
|
||||
filter := git.GetAttributeFilter(cfg.LocalWorkingDir(), cfg.LocalGitDir())
|
||||
if len(filter.Include()) == 0 && len(filter.Exclude()) == 0 {
|
||||
if len(filter.Include()) == 0 {
|
||||
ExitWithError(errors.Errorf("fatal: no Git LFS filters found in .gitattributes"))
|
||||
}
|
||||
|
||||
|
@ -114,6 +114,7 @@ begin_test "migrate import --no-rewrite (no .gitattributes)"
|
||||
git lfs migrate import --no-rewrite *.txt *.md 2>&1 | tee migrate.log
|
||||
if [ ${PIPESTATUS[0]} -eq 0 ]; then
|
||||
echo >&2 "fatal: expected git lfs migrate import --no-rewrite to fail, didn't"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep "no Git LFS filters found in .gitattributes" migrate.log
|
||||
@ -154,6 +155,7 @@ begin_test "migrate import --no-rewrite (nested .gitattributes)"
|
||||
git lfs migrate import --no-rewrite a.md 2>&1 | tee migrate.log
|
||||
if [ ${PIPESTATUS[0]} -eq 0 ]; then
|
||||
echo >&2 "fatal: expected git lfs migrate import --no-rewrite to fail, didn't"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
grep "a.md did not match any Git LFS filters in .gitattributes" migrate.log
|
||||
@ -219,4 +221,4 @@ begin_test "migrate import --no-rewrite (with empty commit message)"
|
||||
exit 1
|
||||
fi
|
||||
)
|
||||
end_test
|
||||
end_test
|
||||
|
Loading…
Reference in New Issue
Block a user