From ca49ef38b4de81da47cb74f63bd81a914446b6e5 Mon Sep 17 00:00:00 2001 From: EBADBEEF Date: Wed, 10 Apr 2024 11:10:49 -0700 Subject: [PATCH] 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 #129 --- repo.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/repo.py b/repo.py index f52e0b00..948cd78b 100644 --- a/repo.py +++ b/repo.py @@ -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(