Merge branch 'sp/smart-http'
* sp/smart-http: (37 commits) http-backend: Let gcc check the format of more printf-type functions. http-backend: Fix access beyond end of string. http-backend: Fix bad treatment of uintmax_t in Content-Length t5551-http-fetch: Work around broken Accept header in libcurl t5551-http-fetch: Work around some libcurl versions http-backend: Protect GIT_PROJECT_ROOT from /../ requests Git-aware CGI to provide dumb HTTP transport http-backend: Test configuration options http-backend: Use http.getanyfile to disable dumb HTTP serving test smart http fetch and push http tests: use /dumb/ URL prefix set httpd port before sourcing lib-httpd t5540-http-push: remove redundant fetches Smart HTTP fetch: gzip requests Smart fetch over HTTP: client side Smart push over HTTP: client side Discover refs via smart HTTP server when available http-backend: more explict LocationMatch http-backend: add example for gitweb on same URL http-backend: use mod_alias instead of mod_rewrite ... Conflicts: .gitignore remote-curl.c
This commit is contained in:
10
commit.c
10
commit.c
@ -199,7 +199,7 @@ struct commit_graft *lookup_commit_graft(const unsigned char *sha1)
|
||||
return commit_graft[pos];
|
||||
}
|
||||
|
||||
int write_shallow_commits(int fd, int use_pack_protocol)
|
||||
int write_shallow_commits(struct strbuf *out, int use_pack_protocol)
|
||||
{
|
||||
int i, count = 0;
|
||||
for (i = 0; i < commit_graft_nr; i++)
|
||||
@ -208,12 +208,10 @@ int write_shallow_commits(int fd, int use_pack_protocol)
|
||||
sha1_to_hex(commit_graft[i]->sha1);
|
||||
count++;
|
||||
if (use_pack_protocol)
|
||||
packet_write(fd, "shallow %s", hex);
|
||||
packet_buf_write(out, "shallow %s", hex);
|
||||
else {
|
||||
if (write_in_full(fd, hex, 40) != 40)
|
||||
break;
|
||||
if (write_str_in_full(fd, "\n") != 1)
|
||||
break;
|
||||
strbuf_addstr(out, hex);
|
||||
strbuf_addch(out, '\n');
|
||||
}
|
||||
}
|
||||
return count;
|
||||
|
Reference in New Issue
Block a user