Skip to content

Commit

Permalink
fix: warn user about old version of git when using mergetool (#3637)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panaetius committed Oct 17, 2023
1 parent af5cdeb commit 5df0ce1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var/
*.egg-info/
.installed.cfg
*.egg
.python-version

# PyInstaller
# Usually these files are written by a python script from a template
Expand Down
7 changes: 7 additions & 0 deletions renku/infrastructure/git_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import os
import shutil
import traceback
from json import JSONDecodeError
from pathlib import Path
from tempfile import mkdtemp
Expand Down Expand Up @@ -116,6 +117,12 @@ def _setup_worktrees(self, repository):
)
)
except Exception:
exc_str = traceback.format_exc(limit=None, chain=True)
if "No such file or directory" in exc_str and "Unable to create" in exc_str:
communication.error(
"Error when trying to sparse checkout worktree. This is likely due to using an old version of "
"git. Please try with a newer version."
)
# NOTE: cleanup worktree
try:
repository.remove_worktree(worktree_path)
Expand Down

0 comments on commit 5df0ce1

Please sign in to comment.