Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
fast-import: don't allow to tag empty branch
[gitweb.git]
/
fast-import.c
diff --git
a/fast-import.c
b/fast-import.c
index 742e7da6b8b58dd0803d89c6ad6c59589274a31b..c44cc11fd7994fd4591bc7e445777da376d481d1 100644
(file)
--- a/
fast-import.c
+++ b/
fast-import.c
@@
-2717,6
+2717,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 == ':') {