Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 76916b5

Browse filesBrowse files
author
Mario Alvarado
committed
Adding dubious ownership handling
1 parent 07f3641 commit 76916b5
Copy full SHA for 76916b5

File tree

1 file changed

+10
-0
lines changed
Filter options

1 file changed

+10
-0
lines changed

‎git/repo/base.py

Copy file name to clipboardExpand all lines: git/repo/base.py
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,16 @@ def __init__(
296296
else:
297297
self.odb = odbt(rootpath)
298298

299+
# Check dubious ownership
300+
try:
301+
if not self.bare or Git.is_cygwin():
302+
_ = self.git.status()
303+
except GitCommandError as err:
304+
if "detected dubious ownership" in err.stderr:
305+
err_msg = f"Detected dubious ownership in repository at: {epath}"
306+
raise InvalidGitRepositoryError(err_msg) from None
307+
raise
308+
299309
def __enter__(self) -> "Repo":
300310
return self
301311

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.