Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit d7bf231

Browse files
committed
Merge branch 'GitPython-1616'
2 parents f0e7e41 + 1808ddd commit d7bf231

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
@@ -1322,7 +1322,12 @@ def _parse_object_header(self, header_line: str) -> Tuple[str, str, int]:
13221322
tokens = header_line.split()
13231323
if len(tokens) != 3:
13241324
if not tokens:
1325-
raise ValueError("SHA could not be resolved, git returned: %r" % (header_line.strip()))
1325+
err_msg = (
1326+
f"SHA is empty, possible dubious ownership in the repository "
1327+
f"""at {self._working_dir}.\n If this is unintended run:\n\n """
1328+
f""" "git config --global --add safe.directory {self._working_dir}" """
1329+
)
1330+
raise ValueError(err_msg)
13261331
else:
13271332
raise ValueError("SHA %s could not be resolved, git returned: %r" % (tokens[0], header_line.strip()))
13281333
# END handle actual return value

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /