Skip to content

Commit

Permalink
squashme: address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Oct 17, 2023
1 parent b45a9a3 commit acfa514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions renku/core/util/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions renku/ui/service/gateways/repository_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down

0 comments on commit acfa514

Please sign in to comment.