Skip to content

Commit 2f30504

Browse files
author
Mario Alvarado
committed
Adding dubious ownership handling
1 parent 07f3641 commit 2f30504

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

git/repo/base.py

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy