示例#1
0
 /*
  * Construct an annotated tag object pointing at another object.
  * <p>
  * The tagger is the committer identity, at the current time as specified by
  * {@link #tick(int)}. The time is not increased.
  * <p>
  * The tag message is empty.
  *
  * @param name
  *            name of the tag. Traditionally a tag name should not start
  *            with {@code refs/tags/}.
  * @param dst
  *            object the tag should be pointed at.
  * @return the annotated tag object.
  * @throws Exception
  */
 public RevTag tag(String name, RevObject dst)
 {
     global::GitSharp.Core.Tag t = new global::GitSharp.Core.Tag(db);
     t.TagType = (Constants.typeString(dst.Type));
     t.Id      = (dst.ToObjectId());
     t.TagName = (name);
     t.Tagger  = (new PersonIdent(committer, now.MillisToUtcDateTime()));
     t.Message = ("");
     return((RevTag)pool.lookupAny(writer.WriteTag(t), Constants.OBJ_TAG));
 }
示例#2
0
        protected RevTag Tag(string name, RevObject dst)
        {
            var t = new Core.Tag(db)
            {
                TagType = Constants.typeString(dst.Type),
                Id      = dst.ToObjectId(),
                TagName = name,
                Tagger  = new PersonIdent(committer, (nowTick).MillisToDateTime()),
                Message = string.Empty
            };

            return((RevTag)rw.lookupAny(_ow.WriteTag(t), Constants.OBJ_TAG));
        }