Skip to content

Commit

Permalink
shallow: only add shallow graft points to new shallow file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Aug 28, 2013
1 parent 3125fe5 commit 6a3bbb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions shallow.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
{
struct write_shallow_data *data = cb_data;
const char *hex = sha1_to_hex(graft->sha1);
if (graft->nr_parent != -1)
return 0;
data->count++;
if (data->use_pack_protocol)
packet_buf_write(data->out, "shallow %s", hex);
Expand Down

0 comments on commit 6a3bbb4

Please sign in to comment.