aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-20 23:51:23 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-20 23:51:23 -0800
commit905bf7742cf5f4a6dea2e75ba2dbd89d5dfaa793 (patch)
tree4f6173217f109d96e31b47805c945222a7ee5171 /commit.c
parent7dacc6c0681203bb24b74c7b3318b1e6d5d16ee5 (diff)
parent354870171bc98dfef7dfa037b3fe9ac9454c94a2 (diff)
downloadgit-905bf7742cf5f4a6dea2e75ba2dbd89d5dfaa793.tar.gz
git-905bf7742cf5f4a6dea2e75ba2dbd89d5dfaa793.tar.xz
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
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/commit.c b/commit.c
index 6393e1b36..51839fbed 100644
--- a/commit.c
+++ b/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;