From acfa5144254e201a5b43d1d15e1442a64324993a Mon Sep 17 00:00:00 2001 From: Tasko Olevski Date: Tue, 17 Oct 2023 17:23:22 +0200 Subject: [PATCH] squashme: address comments --- renku/core/util/git.py | 8 -------- renku/ui/service/gateways/repository_cache.py | 5 ++--- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/renku/core/util/git.py b/renku/core/util/git.py index 04ed95c945..43a1b4e88d 100644 --- a/renku/core/util/git.py +++ b/renku/core/util/git.py @@ -836,14 +836,6 @@ def clone(branch, depth): try: repository = clone(branch=None, depth=None) except errors.GitCommandError: - if re.match("^.* destination path .* already exists and is not an empty directory", err.stderr): - clean_directory() - try: - repository = clone(branch=None, depth=None) - except errors.GitCommandError: - if raise_git_except: - raise - raise error_from_progress(progress, url) if raise_git_except: raise raise error_from_progress(progress, url) diff --git a/renku/ui/service/gateways/repository_cache.py b/renku/ui/service/gateways/repository_cache.py index 6afa4e2c80..c228a73ba7 100644 --- a/renku/ui/service/gateways/repository_cache.py +++ b/renku/ui/service/gateways/repository_cache.py @@ -136,7 +136,6 @@ def _clone_project( "branch": branch, "git_url": git_url, "user_id": user.user_id, - "branch": branch, "commit_sha": commit_sha, } project = cache.make_project(user, project_data, persist=False) @@ -201,7 +200,7 @@ def _clone_project( def _unshallow_project(self, project: Project, user: User): """Turn a shallow clone into a full clone.""" - if project.commit_sha is None: + if project.commit_sha is not None: # NOTE: A project in a detached head state at a specific commit SHA does not make sense to be unshallowed return try: @@ -226,7 +225,7 @@ def _maybe_update_cache(self, project: Project, user: User): if project.fetch_age < PROJECT_FETCH_TIME: return - if project.commit_sha is None: + if project.commit_sha is not None: # NOTE: A project in a detached head state at a specific commit SHA cannot be updated return