Skip to content

Commit ca49ef3

Browse files
committed
repo: remove check for '.git' at end of git remote
I can't think of a reason to enforce this. When script is run by default (at least with git version 2.42.0), there is no '.git' at the end of the remote. Here is what 'git remote -v' shows: origin https://github.com/netbox-community/devicetype-library After removing the check, we can run the script multiple times in a row without deleting the 'repo' folder. Fixes issue netbox-community#129
1 parent dda8ed8 commit ca49ef3

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

repo.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ def pull_repo(self):
4343
self.handle.log("Package devicetype-library is already installed, "
4444
+ f"updating {self.get_absolute_path()}")
4545
self.repo = Repo(self.repo_path)
46-
if not self.repo.remotes.origin.url.endswith('.git'):
47-
self.handle.exception("GitInvalidRepositoryError", self.repo.remotes.origin.url,
48-
f"Origin URL {self.repo.remotes.origin.url} does not end with .git")
4946
self.repo.remotes.origin.pull()
5047
self.repo.git.checkout(self.branch)
5148
self.handle.verbose_log(

0 commit comments

Comments
 (0)