From 07d632c33e537d6e5b78d4aea8316b8ff92262e7 Mon Sep 17 00:00:00 2001 From: nulltoken Date: Sun, 14 Mar 2010 13:23:20 +0100 Subject: [PATCH] Reviewing transport related code against JGit commit 046198cf5f21e5a63e8ec0ecde2ef3fe21db2eae. --- GitSharp.Core/Transport/TcpTransport.cs | 52 ++++++++++---------- GitSharp.Core/Transport/TrackingRefUpdate.cs | 47 ++++++++++++++---- 2 files changed, 64 insertions(+), 35 deletions(-) diff --git a/GitSharp.Core/Transport/TcpTransport.cs b/GitSharp.Core/Transport/TcpTransport.cs index 60cc1b47..5b0f517e 100644 --- a/GitSharp.Core/Transport/TcpTransport.cs +++ b/GitSharp.Core/Transport/TcpTransport.cs @@ -34,30 +34,30 @@ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -namespace GitSharp.Core.Transport -{ - /// - /// The base class for transports based on TCP sockets. This class - /// holds settings common for all TCP based transports. - /// - public abstract class TcpTransport : Transport - { - /// - /// Create a new transport instance. - /// - /// - /// The repository this instance will fetch into, or push out of. - /// This must be the repository passed to . - /// - /// - /// the URI used to access the remote repository. This must be the - /// URI passed to . - /// - protected TcpTransport(Repository local, URIish uri) - : base(local, uri) - { - } - } + */ + +namespace GitSharp.Core.Transport +{ + /// + /// The base class for transports based on TCP sockets. This class + /// holds settings common for all TCP based transports. + /// + public abstract class TcpTransport : Transport + { + /// + /// Create a new transport instance. + /// + /// + /// The repository this instance will fetch into, or push out of. + /// This must be the repository passed to . + /// + /// + /// the URI used to access the remote repository. This must be the + /// URI passed to . + /// + protected TcpTransport(Repository local, URIish uri) + : base(local, uri) + { + } + } } \ No newline at end of file diff --git a/GitSharp.Core/Transport/TrackingRefUpdate.cs b/GitSharp.Core/Transport/TrackingRefUpdate.cs index d343f3b8..e655b914 100644 --- a/GitSharp.Core/Transport/TrackingRefUpdate.cs +++ b/GitSharp.Core/Transport/TrackingRefUpdate.cs @@ -38,25 +38,26 @@ namespace GitSharp.Core.Transport { - + /// + /// Update of a locally stored tracking branch. + /// public class TrackingRefUpdate { - public string RemoteName { get; private set; } private readonly RefUpdate update; public TrackingRefUpdate(Repository db, RefSpec spec, AnyObjectId nv, string msg) : this(db, spec.Destination, spec.Source, spec.Force, nv, msg) { - if (spec == null) - throw new System.ArgumentNullException ("spec"); + if (spec == null) + throw new System.ArgumentNullException("spec"); } public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg) { - if (db == null) - throw new System.ArgumentNullException ("db"); - if (nv == null) - throw new System.ArgumentNullException ("nv"); + if (db == null) + throw new System.ArgumentNullException("db"); + if (nv == null) + throw new System.ArgumentNullException("nv"); RemoteName = remoteName; update = db.UpdateRef(localName); update.IsForceUpdate = forceUpdate; @@ -64,6 +65,18 @@ public TrackingRefUpdate(Repository db, string localName, string remoteName, boo update.setRefLogMessage(msg, true); } + /// + /// the name of the remote ref. + /// + /// Usually this is of the form "refs/heads/master". + /// + public string RemoteName { get; private set; } + + /// + /// Get the name of the local tracking ref. + /// + /// Usually this is of the form "refs/remotes/origin/master". + /// public string LocalName { get @@ -72,6 +85,9 @@ public string LocalName } } + /// + /// Get the new value the ref will be (or was) updated to. Null if the caller has not configured it. + /// public ObjectId NewObjectId { get @@ -80,6 +96,17 @@ public ObjectId NewObjectId } } + /// + /// The old value of the ref, prior to the update being attempted. + /// + /// This value may differ before and after the update method. Initially it is + /// populated with the value of the ref before the lock is taken, but the old + /// value may change if someone else modified the ref between the time we + /// last read it and when the ref was locked for update. + /// + /// Returns the value of the ref prior to the update being attempted; null if + /// the updated has not been attempted yet. + /// public ObjectId OldObjectId { get @@ -88,6 +115,9 @@ public ObjectId OldObjectId } } + /// + /// the status of this update. + /// public RefUpdate.RefUpdateResult Result { get @@ -106,5 +136,4 @@ public void Delete(RevWalk.RevWalk walk) update.delete(walk); } } - } \ No newline at end of file