/** * Persist this commit object * * @ */ public void Save() // [henon] was Commit() in java, but c# won't allow it { if (CommitId != null) throw new InvalidOperationException("exists " + CommitId); CommitId = new ObjectWriter(Repository).WriteCommit(this); }
public WriteTree(DirectoryInfo sourceDirectory, Repository db) : base(sourceDirectory) { ow = new ObjectWriter(db); }
// [henon] was Commit() in java, but c# won't allow it /// <summary> /// Persist this commit object /// </summary> /// <exception cref="IOException"></exception> public void Save() { if (CommitId != null) { throw new InvalidOperationException("exists " + CommitId); } CommitId = new ObjectWriter(Repository).WriteCommit(this); }
/** * Store a tag. * If author, message or type is set make the tag an annotated tag. * * @ */ public void Save() //renamed from Tag { if (TagId != null) throw new InvalidOperationException("exists " + TagId); ObjectId id; if (author != null || message != null || tagType != null) { ObjectId tagid = new ObjectWriter(Repository).WriteTag(this); TagId = tagid; id = tagid; } else { id = Id; } RefUpdate ru = Repository.UpdateRef(Constants.RefsTags + TagName); ru.NewObjectId = id; ru.SetRefLogMessage("tagged " + TagName, false); if (ru.ForceUpdate() == RefUpdate.RefUpdateResult.LockFailure) throw new ObjectWritingException("Unable to lock tag " + TagName); }