Content-Length: 273011 | pFad | http://github.com/gitpython-developers/GitPython/commit/5be123eaea293183c326ee7e1791a3ffbb0bda59

B8 Adding dubious ownership handling · gitpython-developers/GitPython@5be123e · GitHub
Skip to content

Commit 5be123e

Browse files
Mario AlvaradoByron
authored andcommitted
Adding dubious ownership handling
1 parent 5c6a4f4 commit 5be123e

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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/gitpython-developers/GitPython/commit/5be123eaea293183c326ee7e1791a3ffbb0bda59

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy