Skip to content

Commit a3789b2

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

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

git/cmd.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1333,7 +1333,12 @@ def _parse_object_header(self, header_line: str) -> Tuple[str, str, int]:
13331333
tokens = header_line.split()
13341334
if len(tokens) != 3:
13351335
if not tokens:
1336-
raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))
1336+
err_msg = (
1337+
f"SHA is empty, possible dubious ownership in the repository "
1338+
f"""at {self._working_dir}.\n If this is unintended run:\n\n """
1339+
f""" "git config --global --add safe.directory {self._working_dir}" """
1340+
)
1341+
raise ValueError(err_msg)
13371342
else:
13381343
raise ValueError("SHA %s could not be resolved, git returned: %r" % (tokens[0], header_line.strip()))
13391344
# END handle actual return value

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