shallow: only add shallow graft points to new shallow file

for_each_commit_graft() goes through all graft points, and shallow boundaries are just one special kind of grafting. If $GIT_DIR/shallow and $GIT_DIR/info/grafts are both present, write_shallow_commits() may catch both sets, accidentally turning some graft points to shallow boundaries. Don't do that. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Aug 16, 2013 at 16:52 UTC 6a3bbb4db409c5417960ffd3f020f75e0cb36f81
1 file changed +2
shallow.c
+2
@@ -153,6 +153,8 @@ static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
153 {
154 struct write_shallow_data *data = cb_data;
155 const char *hex = sha1_to_hex(graft->sha1);
156 + if (graft->nr_parent != -1)
157 + return 0;
158 data->count++;
159 if (data->use_pack_protocol)
160 packet_buf_write(data->out, "shallow %s", hex);