2
This code is derived from jgit (http://eclipse.org/jgit).
3
Copyright owners are documented in jgit's IP log.
5
This program and the accompanying materials are made available
6
under the terms of the Eclipse Distribution License v1.0 which
7
accompanies this distribution, is reproduced below, and is
8
available at http://www.eclipse.org/org/documents/edl-v10.php
12
Redistribution and use in source and binary forms, with or
13
without modification, are permitted provided that the following
16
- Redistributions of source code must retain the above copyright
17
notice, this list of conditions and the following disclaimer.
19
- Redistributions in binary form must reproduce the above
20
copyright notice, this list of conditions and the following
21
disclaimer in the documentation and/or other materials provided
22
with the distribution.
24
- Neither the name of the Eclipse Foundation, Inc. nor the
25
names of its contributors may be used to endorse or promote
26
products derived from this software without specific prior
29
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
30
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
31
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
38
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
41
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44
using System.Collections.Generic;
49
namespace NGit.Transport
51
/// <summary>Lists known refs from the remote and sends objects to the remote.</summary>
53
/// Lists known refs from the remote and sends objects to the remote.
55
/// A push connection typically connects to the <code>git-receive-pack</code>
56
/// service running where the remote repository is stored. This provides a
57
/// one-way object transfer service to copy objects from the local repository
58
/// into the remote repository, as well as a way to modify the refs stored by the
59
/// remote repository.
61
/// Instances of a PushConnection must be created by a
62
/// <see cref="Transport">Transport</see>
64
/// implements a specific object transfer protocol that both sides of the
65
/// connection understand.
67
/// PushConnection instances are not thread safe and may be accessed by only one
70
/// <seealso cref="Transport">Transport</seealso>
71
public interface PushConnection : Connection
73
/// <summary>Pushes to the remote repository basing on provided specification.</summary>
75
/// Pushes to the remote repository basing on provided specification. This
76
/// possibly result in update/creation/deletion of refs on remote repository
77
/// and sending objects that remote repository need to have a consistent
78
/// objects graph from new refs.
81
/// Only one call per connection is allowed. Subsequent calls will result in
82
/// <see cref="NGit.Errors.TransportException">NGit.Errors.TransportException</see>
86
/// Implementation may use local repository to send a minimum set of objects
87
/// needed by remote repository in efficient way.
88
/// <see cref="Transport.IsPushThin()">Transport.IsPushThin()</see>
89
/// should be honored if applicable.
90
/// refUpdates should be filled with information about status of each update.
93
/// <param name="monitor">
94
/// progress monitor to update the end-user about the amount of
95
/// work completed, or to indicate cancellation. Implementors
96
/// should poll the monitor at regular intervals to look for
97
/// cancellation requests from the user.
99
/// <param name="refUpdates">
100
/// map of remote refnames to remote refs update
101
/// specifications/statuses. Can't be empty. This indicate what
102
/// refs caller want to update on remote side. Only refs updates
104
/// <see cref="Status.NOT_ATTEMPTED">Status.NOT_ATTEMPTED</see>
106
/// Implementation must ensure that and appropriate status with
107
/// optional message should be set during call. No refUpdate with
108
/// <see cref="Status.AWAITING_REPORT">Status.AWAITING_REPORT</see>
110
/// <see cref="Status.NOT_ATTEMPTED">Status.NOT_ATTEMPTED</see>
111
/// can be leaved by implementation after return from this call.
113
/// <exception cref="NGit.Errors.TransportException">
114
/// objects could not be copied due to a network failure,
115
/// critical protocol error, or error on remote side, or
116
/// connection was already used for push - new connection must be
117
/// created. Non-critical errors concerning only isolated refs
118
/// should be placed in refUpdates.
120
void Push(ProgressMonitor monitor, IDictionary<string, RemoteRefUpdate> refUpdates