Skip to content

Commit

Permalink
repo: remove check for '.git' at end of git remote
Browse files Browse the repository at this point in the history
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
  • Loading branch information
EBADBEEF committed Apr 10, 2024
1 parent dda8ed8 commit ca49ef3
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def pull_repo(self):
self.handle.log("Package devicetype-library is already installed, "
+ f"updating {self.get_absolute_path()}")
self.repo = Repo(self.repo_path)
if not self.repo.remotes.origin.url.endswith('.git'):
self.handle.exception("GitInvalidRepositoryError", self.repo.remotes.origin.url,
f"Origin URL {self.repo.remotes.origin.url} does not end with .git")
self.repo.remotes.origin.pull()
self.repo.git.checkout(self.branch)
self.handle.verbose_log(
Expand Down

0 comments on commit ca49ef3

Please sign in to comment.