示例#1
0
 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);
 }
示例#2
0
 private RefSpec(NGit.Transport.RefSpec p)
 {
     force    = p.IsForceUpdate();
     wildcard = p.IsWildcard();
     srcName  = p.GetSource();
     dstName  = p.GetDestination();
 }
示例#3
0
 /// <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);
 }
示例#4
0
 /// <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);
 }
示例#5
0
 /// <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);
 }
示例#6
0
		/// <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;
		}
示例#7
0
		/// <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;
		}
示例#8
0
		/// <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;
		}