Do not check if .git folder exists
git commands will fail anyway if not present
This commit is contained in:
1 parent
99534e4eb9
commit
574af4b7fe
3 files changed
+3
-28
No files matched your search
@@ -134,12 +134,6 @@ class MigrationLinter(object):
|
||||
def lint_all_migrations(self, git_commit_id=None):
|
||||
# Collect migrations
|
||||
if git_commit_id:
|
||||
if not utils.is_git_project(self.django_path):
|
||||
raise ValueError(
|
||||
(
|
||||
"The given project {0} does not seem " "to be versioned by git."
|
||||
).format(self.django_path)
|
||||
)
|
||||
migrations = self._gather_migrations_git(git_commit_id)
|
||||
else:
|
||||
migrations = self._gather_all_migrations()
|
||||
@@ -178,7 +172,7 @@ class MigrationLinter(object):
|
||||
it allows to seperate the instances correctly.
|
||||
"""
|
||||
sqlmigrate_command = (
|
||||
"cd {0} && " "{1} manage.py sqlmigrate {2} {3} " "--database {4}"
|
||||
"cd {0} && {1} manage.py sqlmigrate {2} {3} " "--database {4}"
|
||||
).format(
|
||||
self.django_path, self.python_exe, app_name, migration_name, self.database
|
||||
)
|
||||
@@ -205,7 +199,7 @@ class MigrationLinter(object):
|
||||
migrations = []
|
||||
# Get changes since specified commit
|
||||
git_diff_command = (
|
||||
"cd {0} && " "git diff --name-only --diff-filter=A {1}"
|
||||
"cd {0} && git diff --name-only --diff-filter=A {1}"
|
||||
).format(self.django_path, git_commit_id)
|
||||
logger.info("Executing {0}".format(git_diff_command))
|
||||
diff_process = Popen(git_diff_command, shell=True, stdout=PIPE, stderr=PIPE)
|
||||
|
||||
Reference in new issue
Block a user