Ejemplo n.º 1
0
        /// <summary>Create a new hook chaining the given hooks together.</summary>
        /// <remarks>Create a new hook chaining the given hooks together.</remarks>
        /// <param name="hooks">hooks to execute, in order.</param>
        /// <returns>a new hook chain of the given hooks.</returns>
        public static PostReceiveHook NewChain <_T0>(IList <_T0> hooks) where _T0 : PostReceiveHook
        {
            PostReceiveHook[] newHooks = new PostReceiveHook[hooks.Count];
            int i = 0;

            foreach (PostReceiveHook hook in hooks)
            {
                if (hook != PostReceiveHook.NULL)
                {
                    newHooks[i++] = hook;
                }
            }
            if (i == 0)
            {
                return(PostReceiveHook.NULL);
            }
            else
            {
                if (i == 1)
                {
                    return(newHooks[0]);
                }
                else
                {
                    return(new NGit.Transport.PostReceiveHookChain(newHooks, i));
                }
            }
        }
 /// <summary>Create a new pack receive for an open repository.</summary>
 /// <remarks>Create a new pack receive for an open repository.</remarks>
 /// <param name="into">the destination repository.</param>
 protected internal ReceivePack(Repository into) : base(into)
 {
     preReceive  = PreReceiveHook.NULL;
     postReceive = PostReceiveHook.NULL;
 }
 /// <summary>Set the hook which is invoked after commands are executed.</summary>
 /// <remarks>
 /// Set the hook which is invoked after commands are executed.
 /// <p>
 /// Only successful commands (type is
 /// <see cref="Result.OK">Result.OK</see>
 /// ) are passed into the
 /// hook. The hook may be called with an empty command collection if the
 /// current set all resulted in an error.
 /// </remarks>
 /// <param name="h">the hook instance; may be null to disable the hook.</param>
 public virtual void SetPostReceiveHook(PostReceiveHook h)
 {
     postReceive = h != null ? h : PostReceiveHook.NULL;
 }
Ejemplo n.º 4
0
 /// <summary>Create a new pack receive for an open repository.</summary>
 /// <remarks>Create a new pack receive for an open repository.</remarks>
 /// <param name="into">the destination repository.</param>
 protected internal ReceivePack(Repository into)
     : base(into)
 {
     preReceive = PreReceiveHook.NULL;
     postReceive = PostReceiveHook.NULL;
 }
Ejemplo n.º 5
0
 /// <summary>Set the hook which is invoked after commands are executed.</summary>
 /// <remarks>
 /// Set the hook which is invoked after commands are executed.
 /// <p>
 /// Only successful commands (type is
 /// <see cref="Result.OK">Result.OK</see>
 /// ) are passed into the
 /// hook. The hook may be called with an empty command collection if the
 /// current set all resulted in an error.
 /// </remarks>
 /// <param name="h">the hook instance; may be null to disable the hook.</param>
 public virtual void SetPostReceiveHook(PostReceiveHook h)
 {
     postReceive = h != null ? h : PostReceiveHook.NULL;
 }
Ejemplo n.º 6
0
 /// <summary>Create a new pack receive for an open repository.</summary>
 /// <remarks>Create a new pack receive for an open repository.</remarks>
 /// <param name="into">the destination repository.</param>
 public ReceivePack(Repository into) : base(into)
 {
     preReceive  = PreReceiveHook.NULL;
     postReceive = PostReceiveHook.NULL;
 }
Ejemplo n.º 7
0
		/// <summary>Create a new pack receive for an open repository.</summary>
		/// <remarks>Create a new pack receive for an open repository.</remarks>
		/// <param name="into">the destination repository.</param>
		public ReceivePack(Repository into) : base(into)
		{
			preReceive = PreReceiveHook.NULL;
			postReceive = PostReceiveHook.NULL;
		}