public override bool Equals(object obj) { if (!(obj is NGit.Transport.RefSpec)) { return(false); } NGit.Transport.RefSpec b = (NGit.Transport.RefSpec)obj; if (IsForceUpdate() != b.IsForceUpdate()) { return(false); } if (IsWildcard() != b.IsWildcard()) { return(false); } if (!Eq(GetSource(), b.GetSource())) { return(false); } if (!Eq(GetDestination(), b.GetDestination())) { return(false); } return(true); }
private RefSpec(NGit.Transport.RefSpec p) { force = p.IsForceUpdate(); wildcard = p.IsWildcard(); srcName = p.GetSource(); dstName = p.GetDestination(); }
/// <summary>Create a new RefSpec with a different source/destination name setting.</summary> /// <remarks>Create a new RefSpec with a different source/destination name setting.</remarks> /// <param name="source">new value for source in the returned instance.</param> /// <param name="destination">new value for destination in the returned instance.</param> /// <returns>a new RefSpec with destination as specified.</returns> /// <exception cref="System.ArgumentException"> /// The wildcard status of the new source disagrees with the /// wildcard status of the new destination. /// </exception> public virtual NGit.Transport.RefSpec SetSourceDestination(string source, string destination) { if (IsWildcard(source) != IsWildcard(destination)) { throw new InvalidOperationException(JGitText.Get().sourceDestinationMustMatch); } NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.wildcard = IsWildcard(source); r.srcName = source; r.dstName = destination; return(r); }
/// <summary>Create a new RefSpec with a different destination name setting.</summary> /// <remarks>Create a new RefSpec with a different destination name setting.</remarks> /// <param name="destination">new value for destination in the returned instance.</param> /// <returns>a new RefSpec with destination as specified.</returns> /// <exception cref="System.InvalidOperationException"> /// There is already a source configured, and the wildcard status /// of the existing source disagrees with the wildcard status of /// the new destination. /// </exception> public virtual NGit.Transport.RefSpec SetDestination(string destination) { NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.dstName = destination; if (IsWildcard(r.dstName) && r.srcName == null) { throw new InvalidOperationException(JGitText.Get().sourceIsNotAWildcard); } if (IsWildcard(r.srcName) != IsWildcard(r.dstName)) { throw new InvalidOperationException(JGitText.Get().sourceDestinationMustMatch); } return(r); }
/// <summary>Create a new RefSpec with a different force update setting.</summary> /// <remarks>Create a new RefSpec with a different force update setting.</remarks> /// <param name="forceUpdate">new value for force update in the returned instance.</param> /// <returns>a new RefSpec with force update as specified.</returns> public virtual NGit.Transport.RefSpec SetForceUpdate(bool forceUpdate) { NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.force = forceUpdate; return(r); }
/// <summary>Create a new RefSpec with a different source/destination name setting.</summary> /// <remarks>Create a new RefSpec with a different source/destination name setting.</remarks> /// <param name="source">new value for source in the returned instance.</param> /// <param name="destination">new value for destination in the returned instance.</param> /// <returns>a new RefSpec with destination as specified.</returns> /// <exception cref="System.ArgumentException"> /// The wildcard status of the new source disagrees with the /// wildcard status of the new destination. /// </exception> public virtual NGit.Transport.RefSpec SetSourceDestination(string source, string destination) { if (IsWildcard(source) != IsWildcard(destination)) { throw new InvalidOperationException(JGitText.Get().sourceDestinationMustMatch); } NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.wildcard = IsWildcard(source); r.srcName = source; r.dstName = destination; return r; }
/// <summary>Create a new RefSpec with a different destination name setting.</summary> /// <remarks>Create a new RefSpec with a different destination name setting.</remarks> /// <param name="destination">new value for destination in the returned instance.</param> /// <returns>a new RefSpec with destination as specified.</returns> /// <exception cref="System.InvalidOperationException"> /// There is already a source configured, and the wildcard status /// of the existing source disagrees with the wildcard status of /// the new destination. /// </exception> public virtual NGit.Transport.RefSpec SetDestination(string destination) { NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.dstName = destination; if (IsWildcard(r.dstName) && r.srcName == null) { throw new InvalidOperationException(JGitText.Get().sourceIsNotAWildcard); } if (IsWildcard(r.srcName) != IsWildcard(r.dstName)) { throw new InvalidOperationException(JGitText.Get().sourceDestinationMustMatch); } return r; }
/// <summary>Create a new RefSpec with a different force update setting.</summary> /// <remarks>Create a new RefSpec with a different force update setting.</remarks> /// <param name="forceUpdate">new value for force update in the returned instance.</param> /// <returns>a new RefSpec with force update as specified.</returns> public virtual NGit.Transport.RefSpec SetForceUpdate(bool forceUpdate) { NGit.Transport.RefSpec r = new NGit.Transport.RefSpec(this); r.force = forceUpdate; return r; }