Merge pull request #3227 from git-lfs/ttaylorr/migrate-install-hooks
commands/command_migrate_import.go: install hooks
This commit is contained in:
commit
830dbf1243
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user