mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 19:58:54 -05:00
[Downloader] Disable all git auth prompts on clone/pull (#3159)
* fix(downloader): disable all git auth prompts on clone/pull * chore(changelog): add towncrier entry
This commit is contained in:
parent
672050727f
commit
0f62614055
1
changelog.d/downloader/3159.bugfix.rst
Normal file
1
changelog.d/downloader/3159.bugfix.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
Disable all git auth prompts when adding/updating repo with Downloader.
|
||||||
@ -87,13 +87,21 @@ class ProcessFormatter(Formatter):
|
|||||||
|
|
||||||
|
|
||||||
class Repo(RepoJSONMixin):
|
class Repo(RepoJSONMixin):
|
||||||
GIT_CLONE = "git clone --recurse-submodules -b {branch} {url} {folder}"
|
GIT_CLONE = (
|
||||||
GIT_CLONE_NO_BRANCH = "git clone --recurse-submodules {url} {folder}"
|
"git clone -c credential.helper= -c core.askpass="
|
||||||
|
" --recurse-submodules -b {branch} {url} {folder}"
|
||||||
|
)
|
||||||
|
GIT_CLONE_NO_BRANCH = (
|
||||||
|
"git -c credential.helper= -c core.askpass= clone --recurse-submodules {url} {folder}"
|
||||||
|
)
|
||||||
GIT_CURRENT_BRANCH = "git -C {path} symbolic-ref --short HEAD"
|
GIT_CURRENT_BRANCH = "git -C {path} symbolic-ref --short HEAD"
|
||||||
GIT_CURRENT_COMMIT = "git -C {path} rev-parse HEAD"
|
GIT_CURRENT_COMMIT = "git -C {path} rev-parse HEAD"
|
||||||
GIT_LATEST_COMMIT = "git -C {path} rev-parse {branch}"
|
GIT_LATEST_COMMIT = "git -C {path} rev-parse {branch}"
|
||||||
GIT_HARD_RESET = "git -C {path} reset --hard origin/{branch} -q"
|
GIT_HARD_RESET = "git -C {path} reset --hard origin/{branch} -q"
|
||||||
GIT_PULL = "git -C {path} pull --recurse-submodules -q --ff-only"
|
GIT_PULL = (
|
||||||
|
"git -c credential.helper= -c core.askpass= -C {path}"
|
||||||
|
" pull --recurse-submodules -q --ff-only"
|
||||||
|
)
|
||||||
GIT_DIFF_FILE_STATUS = (
|
GIT_DIFF_FILE_STATUS = (
|
||||||
"git -C {path} diff-tree --no-commit-id --name-status"
|
"git -C {path} diff-tree --no-commit-id --name-status"
|
||||||
" -r -z --line-prefix='\t' {old_rev} {new_rev}"
|
" -r -z --line-prefix='\t' {old_rev} {new_rev}"
|
||||||
@ -513,6 +521,7 @@ class Repo(RepoJSONMixin):
|
|||||||
"""
|
"""
|
||||||
env = os.environ.copy()
|
env = os.environ.copy()
|
||||||
env["GIT_TERMINAL_PROMPT"] = "0"
|
env["GIT_TERMINAL_PROMPT"] = "0"
|
||||||
|
env.pop("GIT_ASKPASS", None)
|
||||||
# attempt to force all output to plain ascii english
|
# attempt to force all output to plain ascii english
|
||||||
# some methods that parse output may expect it
|
# some methods that parse output may expect it
|
||||||
# according to gettext manual both variables have to be set:
|
# according to gettext manual both variables have to be set:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user