Merge pull request #3227 from git-lfs/ttaylorr/migrate-install-hooks

commands/command_migrate_import.go: install hooks
This commit is contained in:
Taylor Blau 2018-09-05 14:37:09 -04:00 committed by GitHub
commit 830dbf1243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

@ -33,6 +33,11 @@ func migrateImportCommand(cmd *cobra.Command, args []string) {
} }
defer db.Close() defer db.Close()
// To avoid confusion later, let's make sure that we've installed the
// necessary hooks so that a newly migrated repository is `git
// push`-able immediately following a `git lfs migrate import`.
installHooks(false)
if migrateNoRewrite { if migrateNoRewrite {
if migrateFixup { if migrateFixup {
ExitWithError(errors.Errorf("fatal: --no-rewrite and --fixup cannot be combined")) ExitWithError(errors.Errorf("fatal: --no-rewrite and --fixup cannot be combined"))

@ -30,6 +30,10 @@ begin_test "migrate import (default branch)"
echo "$master_attrs" | grep -q "*.md filter=lfs diff=lfs merge=lfs" echo "$master_attrs" | grep -q "*.md filter=lfs diff=lfs merge=lfs"
echo "$master_attrs" | grep -q "*.txt filter=lfs diff=lfs merge=lfs" echo "$master_attrs" | grep -q "*.txt filter=lfs diff=lfs merge=lfs"
# Ensure that hooks are installed. If we find 'git-lfs' somewhere in
# .git/hooks/pre-push we assume that the rest went correctly, too.
grep -q "git-lfs" .git/hooks/pre-push
) )
end_test end_test