Skip to content

Commit ed6f9e4

Browse files
committed
AUR: disable ControlPersist so that no process is left behind
1 parent 9d08977 commit ed6f9e4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lilac2/api.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from .vendor.myutils import at_dir, file_lock
2323
from .vendor.htmlutils import parse_document_from_httpx
2424

25-
from .cmd import git_pull, git_push, UNTRUSTED_PREFIX
25+
from .cmd import git_push, UNTRUSTED_PREFIX
2626
from .cmd import run_cmd as _run_cmd
2727
from . import const, intl
2828
from .const import _G, SPECIAL_FILES
@@ -365,17 +365,20 @@ def _aur_exists(pkgbase: str) -> bool:
365365

366366
def _ensure_aur_repo(pkgbase: str) -> Path:
367367
lockfile = const.AUR_REPO_DIR / (pkgbase + '.lock')
368+
env = os.environ.copy()
369+
env['GIT_SSH_COMMAND'] = 'ssh -o ControlPersist=no'
368370
with file_lock(lockfile):
369371
aurpath = const.AUR_REPO_DIR / pkgbase
370372
if not aurpath.is_dir():
371373
logger.info('cloning AUR repo: %s', aurpath)
372374
with at_dir(const.AUR_REPO_DIR):
373-
_run_cmd(['git', 'clone', f'[email protected]:{pkgbase}.git'])
375+
_run_cmd(['git', 'clone', f'[email protected]:{pkgbase}.git'],
376+
env=env)
374377
else:
375378
with at_dir(aurpath):
376379
# reset everything, dropping local commits
377380
_run_cmd(['git', 'reset', '--hard', 'origin/master'])
378-
git_pull()
381+
_run_cmd(['git', 'pull', '--no-edit'], env=env)
379382

380383
return aurpath
381384

0 commit comments

Comments
 (0)