diff --git a/fast-import.c b/fast-import.c
index 742e7da6b8b58dd0803d89c6ad6c59589274a31b..c44cc11fd7994fd4591bc7e445777da376d481d1 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
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 == ':') {