aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/repository.go b/repository.go
index ab14eba..6da15a1 100644
--- a/repository.go
+++ b/repository.go
@@ -532,11 +532,16 @@ func (r *Repository) createTagObject(name string, hash plumbing.Hash, opts *TagO
return plumbing.ZeroHash, err
}
+ rawobj, err := object.GetObject(r.Storer, hash)
+ if err != nil {
+ return plumbing.ZeroHash, err
+ }
+
tag := &object.Tag{
Name: name,
Tagger: *opts.Tagger,
Message: opts.Message,
- TargetType: opts.TargetType,
+ TargetType: rawobj.Type(),
Target: hash,
}