Mercurial > hg-git-serve
changeset 19:ba45dc4ed212
Add git-upload-archive command.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Mon, 23 Feb 2026 17:12:03 -0500 |
| parents | b83450c3727a |
| children | 84dfbee2ced6 |
| files | src/hgext3rd/hggit_serve/_ssh.py |
| diffstat | 1 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/hgext3rd/hggit_serve/_ssh.py Sun Feb 22 13:49:30 2026 -0500 +++ b/src/hgext3rd/hggit_serve/_ssh.py Mon Feb 23 17:12:03 2026 -0500 @@ -111,4 +111,22 @@ return 0 +@_command( + b'git-upload-archive', + [], + helpcategory=b'import', + intents=(b'readonly',), +) +def _git_upload_archive(ui: hgui.ui, repo: hgrepo.IRepo) -> int: + """Server-side handler for ``git archive --remote``.""" + if not xp.is_gitty(repo): + raise _not_git() + upload_archive = ui.configlist( + b'hggit-serve', b'upload-archive', default=(b'git', b'upload-archive') + ) + return subprocess.call( + (*upload_archive, repo.githandler.gitdir), close_fds=True + ) + + __all__ = ('cmdtable',)
