Skip to content

Commit 5df0ce1

Browse files
authored
fix: warn user about old version of git when using mergetool (#3637)
1 parent af5cdeb commit 5df0ce1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ var/
3535
*.egg-info/
3636
.installed.cfg
3737
*.egg
38+
.python-version
3839

3940
# PyInstaller
4041
# Usually these files are written by a python script from a template

renku/infrastructure/git_merger.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import os
1919
import shutil
20+
import traceback
2021
from json import JSONDecodeError
2122
from pathlib import Path
2223
from tempfile import mkdtemp
@@ -116,6 +117,12 @@ def _setup_worktrees(self, repository):
116117
)
117118
)
118119
except Exception:
120+
exc_str = traceback.format_exc(limit=None, chain=True)
121+
if "No such file or directory" in exc_str and "Unable to create" in exc_str:
122+
communication.error(
123+
"Error when trying to sparse checkout worktree. This is likely due to using an old version of "
124+
"git. Please try with a newer version."
125+
)
119126
# NOTE: cleanup worktree
120127
try:
121128
repository.remove_worktree(worktree_path)

0 commit comments

Comments
 (0)