Skip to content

Commit

Permalink
added check in update hooks to see if the repo url is local
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Bowden committed Jun 24, 2024
1 parent 35b630a commit 4d8ffb1
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions secureli/modules/shared/abstractions/pre_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def check_for_hook_updates(
old_rev_info = HookRepoRevInfo.from_config(repo_config_dict)

# if the repo doesn't appear to be valid, don't try to update it
if not self._is_potential_git_repo(old_rev_info.repo):
if old_rev_info.repo == "local":
continue

# if the revision currently specified in .pre-commit-config.yaml looks like a full git SHA
Expand Down Expand Up @@ -433,14 +433,3 @@ def _get_outdated_repos(
repos = [key for key in outdated_repos.keys()]

return repos

def _is_potential_git_repo(self, path):
try:
urlparse(path)
except Exception:
try:
_ = Repo(path).git_dir
except:
return False

return True

0 comments on commit 4d8ffb1

Please sign in to comment.