File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 15
15
PRIMER_DIRECTORY_PATH = Path ("tests" ) / ".pylint_primer_tests"
16
16
17
17
18
+ class DirtyPrimerDirectoryException (Exception ):
19
+ """We can't pull if there's local changes."""
20
+
21
+ def __init__ (self , path : Path | str ):
22
+ super ().__init__ (
23
+ rf"""
24
+
25
+ /!\ Can't pull /!\
26
+
27
+ In order for the prepare command to be able to pull please cleanup your local repo:
28
+ cd { path }
29
+ git diff
30
+ """
31
+ )
32
+
33
+
18
34
class PackageToLint :
19
35
"""Represents data about a package to be tested during primer tests."""
20
36
@@ -120,6 +136,8 @@ def _pull_repository(self) -> str:
120
136
)
121
137
try :
122
138
repo = Repo (self .clone_directory )
139
+ if repo .is_dirty ():
140
+ raise DirtyPrimerDirectoryException (self .clone_directory )
123
141
origin = repo .remotes .origin
124
142
origin .pull ()
125
143
except GitCommandError as e :
You can’t perform that action at this time.
0 commit comments