X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=8d8ea3c45c0be5481c7b452c27ee0d163d69fb00;hb=abe277301996d4b30f2c8f48cf92dcf677af783d;hp=f9347f55bac6b2d9a775c165013aa7107790e5f4;hpb=9bd500048d467791902b1a5e8c22165325952fde;p=git.git diff --git a/fast-import.c b/fast-import.c index f9347f55b..8d8ea3c45 100644 --- a/fast-import.c +++ b/fast-import.c @@ -2411,6 +2411,8 @@ static void note_change_n(struct branch *b, unsigned char old_fanout) /* */ s = lookup_branch(p); if (s) { + if (is_null_sha1(s->sha1)) + die("Can't add a note on empty branch."); hashcpy(commit_sha1, s->sha1); } else if (*p == ':') { uintmax_t commit_mark = strtoumax(p + 1, NULL, 10); @@ -2712,6 +2714,8 @@ static void parse_new_tag(void) from = strchr(command_buf.buf, ' ') + 1; s = lookup_branch(from); if (s) { + if (is_null_sha1(s->sha1)) + die("Can't tag an empty branch."); hashcpy(sha1, s->sha1); type = OBJ_COMMIT; } else if (*from == ':') {