From 294e15fc19b5ba370b703d003920d000a4f5547a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Thu, 18 Aug 2011 19:29:36 +0700 Subject: Move write_shallow_commits to fetch-pack.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function produces network traffic and should be in fetch-pack. It has been in commit.c because it needs to iterate (private) graft list. It can now do so using for_each_commit_graft(). Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- commit.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'commit.c') diff --git a/commit.c b/commit.c index 246cd18b0..f271f590a 100644 --- a/commit.c +++ b/commit.c @@ -222,24 +222,6 @@ int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data) return ret; } -int write_shallow_commits(struct strbuf *out, int use_pack_protocol) -{ - int i, count = 0; - for (i = 0; i < commit_graft_nr; i++) - if (commit_graft[i]->nr_parent < 0) { - const char *hex = - sha1_to_hex(commit_graft[i]->sha1); - count++; - if (use_pack_protocol) - packet_buf_write(out, "shallow %s", hex); - else { - strbuf_addstr(out, hex); - strbuf_addch(out, '\n'); - } - } - return count; -} - int unregister_shallow(const unsigned char *sha1) { int pos = commit_graft_pos(sha1); -- cgit v1.2.1