/// <summary> /// Create a new command for /// <see cref="BaseReceivePack">BaseReceivePack</see> /// . /// </summary> /// <param name="oldId"> /// the old object id; must not be null. Use /// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see> /// to indicate a ref creation. /// </param> /// <param name="newId"> /// the new object id; must not be null. Use /// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see> /// to indicate a ref deletion. /// </param> /// <param name="name">name of the ref being affected.</param> /// <param name="type">type of the command.</param> /// <since>2.0</since> public ReceiveCommand(ObjectId oldId, ObjectId newId, string name, ReceiveCommand.Type type) { this.oldId = oldId; this.newId = newId; this.name = name; this.type = type; }
/// <summary> /// Create a new command for /// <see cref="BaseReceivePack">BaseReceivePack</see> /// . /// </summary> /// <param name="oldId"> /// the old object id; must not be null. Use /// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see> /// to indicate a ref creation. /// </param> /// <param name="newId"> /// the new object id; must not be null. Use /// <see cref="NGit.ObjectId.ZeroId()">NGit.ObjectId.ZeroId()</see> /// to indicate a ref deletion. /// </param> /// <param name="name">name of the ref being affected.</param> public ReceiveCommand(ObjectId oldId, ObjectId newId, string name) { this.oldId = oldId; this.newId = newId; this.name = name; type = ReceiveCommand.Type.UPDATE; if (ObjectId.ZeroId.Equals(oldId)) { type = ReceiveCommand.Type.CREATE; } if (ObjectId.ZeroId.Equals(newId)) { type = ReceiveCommand.Type.DELETE; } status = ReceiveCommand.Result.NOT_ATTEMPTED; }
internal virtual void SetTypeFastForwardUpdate() { type = ReceiveCommand.Type.UPDATE; typeIsCorrect = true; }
internal virtual void SetType(ReceiveCommand.Type t) { type = t; }