mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 02:16:09 -05:00
Update ambiguous oid parsing to detect candidates on Git 2.31+ (#4897)
* Update ambiguous oid parsing to detect candidates on Git 2.31+ * Update tests
This commit is contained in:
@@ -10,6 +10,7 @@ from redbot.cogs.downloader.repo_manager import RepoManager, Repo, ProcessFormat
|
||||
from redbot.cogs.downloader.installable import Installable, InstalledModule
|
||||
|
||||
__all__ = [
|
||||
"GIT_VERSION",
|
||||
"repo_manager",
|
||||
"repo",
|
||||
"bot_repo",
|
||||
@@ -27,6 +28,17 @@ __all__ = [
|
||||
]
|
||||
|
||||
|
||||
def _get_git_version():
|
||||
"""Returns version tuple in format: (major, minor)"""
|
||||
raw_version = sp.check_output(("git", "version"), text=True)[12:]
|
||||
# we're only interested in major and minor version if we will ever need micro
|
||||
# there's more handling needed for versions like `2.25.0-rc1` and `2.25.0.windows.1`
|
||||
return tuple(int(n) for n in raw_version.split(".", maxsplit=3)[:2])
|
||||
|
||||
|
||||
GIT_VERSION = _get_git_version()
|
||||
|
||||
|
||||
async def fake_run_noprint(*args, **kwargs):
|
||||
fake_result_tuple = namedtuple("fake_result", "returncode result")
|
||||
res = fake_result_tuple(0, (args, kwargs))
|
||||
|
||||
Reference in New Issue
Block a user