summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMykola Nikishov <mn@mn.com.ua>2009-11-25 22:37:02 +0200
committerMykola Nikishov <mn@mn.com.ua>2009-11-29 19:31:01 +0200
commit7eef835ad50971bf6ecc3fcff2ebd9558757c28f (patch)
tree756923d603cbb88e7895dfbac8ebbb438dde083f
parent6f06be9bc29b5d6c21264be48316c65ade42df62 (diff)
downloadjgit-7eef835ad50971bf6ecc3fcff2ebd9558757c28f.tar.gz
jgit-7eef835ad50971bf6ecc3fcff2ebd9558757c28f.zip
Replace a hard-coded default remote's name with a constant
Change-Id: I4e369382b8a83a5c0772462d1b176b1e23910ada
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java2
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java4
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java2
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java3
4 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
index 605f9552f8..a136df5618 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java
@@ -73,7 +73,7 @@ import org.eclipse.jgit.transport.URIish;
@Command(common = true, usage = "Clone a repository into a new directory")
class Clone extends AbstractFetchCommand {
@Option(name = "--origin", aliases = { "-o" }, metaVar = "name", usage = "use <name> instead of 'origin' to track upstream")
- private String remoteName = "origin";
+ private String remoteName = Constants.DEFAULT_REMOTE_NAME;
@Argument(index = 0, required = true, metaVar = "uri-ish")
private String sourceUri;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
index 7315e44cb5..6ed468510f 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Fetch.java
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008-2009, Google Inc.
+ * Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua>
* Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org>
* and other copyright owners as documented in the project's IP log.
*
@@ -48,6 +49,7 @@ import java.util.List;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.Option;
+import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.TextProgressMonitor;
import org.eclipse.jgit.transport.FetchResult;
import org.eclipse.jgit.transport.RefSpec;
@@ -81,7 +83,7 @@ class Fetch extends AbstractFetchCommand {
}
@Argument(index = 0, metaVar = "uri-ish")
- private String remote = "origin";
+ private String remote = Constants.DEFAULT_REMOTE_NAME;
@Argument(index = 1, metaVar = "refspec")
private List<RefSpec> toget;
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
index 8afa5227d2..6248ec2991 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Push.java
@@ -65,7 +65,7 @@ class Push extends TextBuiltin {
int timeout = -1;
@Argument(index = 0, metaVar = "uri-ish")
- private String remote = "origin";
+ private String remote = Constants.DEFAULT_REMOTE_NAME;
@Argument(index = 1, metaVar = "refspec")
private final List<RefSpec> refSpecs = new ArrayList<RefSpec>();
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
index 42f3debc2c..de1315957b 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/Constants.java
@@ -258,6 +258,9 @@ public final class Constants {
/** A gitignore file name */
public static final String GITIGNORE_FILENAME = ".gitignore";
+ /** Default remote name used by clone, push and fetch operations */
+ public static final String DEFAULT_REMOTE_NAME = "origin";
+
/**
* Create a new digest function for objects.
*