[EGIT PATCH 04/23] New constructor without RefSpec for TrackingRefUpdate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



New constructor operates directly on RefSpec components: remote name,
local name, force flag.

Signed-off-by: Marek Zawirski <marek.zawirski@xxxxxxxxx>
---
 .../spearce/jgit/transport/TrackingRefUpdate.java  |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/org.spearce.jgit/src/org/spearce/jgit/transport/TrackingRefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/transport/TrackingRefUpdate.java
index 771e77a..a84b38a 100644
--- a/org.spearce.jgit/src/org/spearce/jgit/transport/TrackingRefUpdate.java
+++ b/org.spearce.jgit/src/org/spearce/jgit/transport/TrackingRefUpdate.java
@@ -55,9 +55,16 @@ public class TrackingRefUpdate {
 
 	TrackingRefUpdate(final Repository db, final RefSpec spec,
 			final AnyObjectId nv, final String msg) throws IOException {
-		remoteName = spec.getSource();
-		update = db.updateRef(spec.getDestination());
-		update.setForceUpdate(spec.isForceUpdate());
+		this(db, spec.getDestination(), spec.getSource(), spec.isForceUpdate(),
+				nv, msg);
+	}
+
+	TrackingRefUpdate(final Repository db, final String localName,
+			final String remoteName, final boolean forceUpdate,
+			final AnyObjectId nv, final String msg) throws IOException {
+		this.remoteName = remoteName;
+		update = db.updateRef(localName);
+		update.setForceUpdate(forceUpdate);
 		update.setNewObjectId(nv);
 		update.setRefLogMessage(msg, true);
 	}
-- 
1.5.5.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux