Show More
@@ -79,14 +79,14 b' class GitRepository(object):' | |||||
79 | # blows up if you sprinkle "flush" (0000) as "0001\n". |
|
79 | # blows up if you sprinkle "flush" (0000) as "0001\n". | |
80 | # It reads binary, per number of bytes specified. |
|
80 | # It reads binary, per number of bytes specified. | |
81 | # if you do add '\n' as part of data, count it. |
|
81 | # if you do add '\n' as part of data, count it. | |
82 |
|
|
82 | server_advert = '# service=%s' % git_command | |
|
83 | packet_len = str(hex(len(server_advert) + 4)[2:].rjust(4, '0')).lower() | |||
83 | try: |
|
84 | try: | |
84 | out = subprocessio.SubprocessIOChunker( |
|
85 | out = subprocessio.SubprocessIOChunker( | |
85 | r'git %s --stateless-rpc --advertise-refs "%s"' % ( |
|
86 | r'git %s --stateless-rpc --advertise-refs "%s"' % ( | |
86 | git_command[4:], self.content_path), |
|
87 | git_command[4:], self.content_path), | |
87 | starting_values=[ |
|
88 | starting_values=[ | |
88 |
|
|
89 | packet_len + server_advert + '0000' | |
89 | .rjust(4, '0') + smart_server_advert + '0000') |
|
|||
90 | ] |
|
90 | ] | |
91 | ) |
|
91 | ) | |
92 | except EnvironmentError, e: |
|
92 | except EnvironmentError, e: | |
@@ -94,6 +94,7 b' class GitRepository(object):' | |||||
94 | raise exc.HTTPExpectationFailed() |
|
94 | raise exc.HTTPExpectationFailed() | |
95 | resp = Response() |
|
95 | resp = Response() | |
96 | resp.content_type = 'application/x-%s-advertisement' % str(git_command) |
|
96 | resp.content_type = 'application/x-%s-advertisement' % str(git_command) | |
|
97 | resp.charset = None | |||
97 | resp.app_iter = out |
|
98 | resp.app_iter = out | |
98 | return resp |
|
99 | return resp | |
99 |
|
100 |
General Comments 0
You need to be logged in to leave comments.
Login now