diff options
author | Carlos Martín Nieto <cmn@elego.de> | 2011-04-06 10:58:14 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-04-08 03:36:53 +0300 |
commit | 7bc66a79fa8161dc4101cf3953a1e481a4debd91 (patch) | |
tree | 187a5fdd94b0aa780791cd67e534324607ff2065 /src | |
parent | 81234673a1f7cd5d92f0dd5f03d1442ec1ed2d62 (diff) | |
download | libgit2-7bc66a79fa8161dc4101cf3953a1e481a4debd91.tar.gz |
tag: don't allow tags to non-existent objects
These indicate an inconsistency in the repository which we've created,
so don't allow them.
Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/tag.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -209,6 +209,9 @@ static int tag_create( return error; } + if (!git_odb_exists(repo->db, target)) + return GIT_ENOTFOUND; + /* Try to find out what the type is */ if (target_type == GIT_OBJ_ANY) { size_t _unused; |