public static ReflogRecord CreateReflogRecord(Reflog reflog, ReflogRecordData reflogRecordData) { Verify.Argument.IsNotNull(reflog, "reflog"); Verify.Argument.IsNotNull(reflogRecordData, "reflogRecordData"); var repository = reflog.Repository; Revision revision; lock (repository.Revisions.SyncRoot) { revision = repository.Revisions.GetOrCreateRevision(reflogRecordData.Revision.SHA1); } if (!revision.IsLoaded) { UpdateRevision(revision, reflogRecordData.Revision); } return(new ReflogRecord(repository, reflog, revision, reflogRecordData.Message, reflogRecordData.Index)); }
public static void UpdateReflogRecord(ReflogRecord reflogRecord, ReflogRecordData reflogRecordData) { Verify.Argument.IsNotNull(reflogRecord, "reflogRecord"); Verify.Argument.IsNotNull(reflogRecordData, "reflogRecordData"); reflogRecord.Index = reflogRecordData.Index; reflogRecord.Message = reflogRecordData.Message; Revision revision; lock (reflogRecord.Repository.Revisions.SyncRoot) { revision = reflogRecord.Repository.Revisions.GetOrCreateRevision(reflogRecordData.Revision.SHA1); } if (!revision.IsLoaded) { UpdateRevision(revision, reflogRecordData.Revision); } reflogRecord.Revision = revision; }