mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Fix the errors related to installed module having invalid commit data (#4086)
This commit is contained in:
@@ -199,6 +199,11 @@ class Repo(RepoJSONMixin):
|
||||
descendant_rev : `str`
|
||||
Descendant revision
|
||||
|
||||
Raises
|
||||
------
|
||||
.UnknownRevision
|
||||
When git cannot find one of the provided revisions.
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool
|
||||
@@ -213,10 +218,17 @@ class Repo(RepoJSONMixin):
|
||||
maybe_ancestor_rev=maybe_ancestor_rev,
|
||||
descendant_rev=descendant_rev,
|
||||
)
|
||||
p = await self._run(git_command, valid_exit_codes=valid_exit_codes)
|
||||
p = await self._run(git_command, valid_exit_codes=valid_exit_codes, debug_only=True)
|
||||
|
||||
if p.returncode in valid_exit_codes:
|
||||
return not bool(p.returncode)
|
||||
|
||||
# this is a plumbing command so we're safe here
|
||||
stderr = p.stderr.decode(**DECODE_PARAMS).strip()
|
||||
if stderr.startswith(("fatal: Not a valid object name", "fatal: Not a valid commit name")):
|
||||
rev, *__ = stderr[31:].split(maxsplit=1)
|
||||
raise errors.UnknownRevision(f"Revision {rev} cannot be found.", git_command)
|
||||
|
||||
raise errors.GitException(
|
||||
f"Git failed to determine if commit {maybe_ancestor_rev}"
|
||||
f" is ancestor of {descendant_rev} for repo at path: {self.folder_path}",
|
||||
|
||||
Reference in New Issue
Block a user