2 # dul-upload-pack - git-upload-pack in python
3 # Copyright (C) 2008 John Carr <john.carr@unrouted.co.uk>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; version 2
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
21 from dulwich.repo import Repo
22 from dulwich.server import GitBackend, UploadPackHandler
25 sys.stdout.write(data)
28 if __name__ == "__main__":
33 backend = GitBackend(Repo(gitdir))
34 handler = UploadPackHandler(backend, sys.stdin.read, send_fn)