aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-10-20 18:08:59 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-10-21 09:29:52 +0200
commitc24eee4fa4db682b138a7a212cf711ab682d02f6 (patch)
treea0b756998f5ceb64fadef2b514f2cef68c8b9524 /org.eclipse.jgit.pgm/src/org/eclipse
parentbceac7bd03e5a7660cb4f934f0db7ada7eab7b54 (diff)
downloadjgit-c24eee4fa4db682b138a7a212cf711ab682d02f6.tar.gz
jgit-c24eee4fa4db682b138a7a212cf711ab682d02f6.zip
[pgm] Add --mirror option to clone command
Bug: 552173 Change-Id: Ic8a98b2e0f8f29afd599723f93e51b06b9f13314 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java6
1 files changed, 5 insertions, 1 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 fe2462012b..a6a031e2c7 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
@@ -74,6 +74,9 @@ class Clone extends AbstractFetchCommand implements CloneCommand.Callback {
@Option(name = "--bare", usage = "usage_bareClone")
private boolean isBare;
+ @Option(name = "--mirror", usage = "usage_mirrorClone")
+ private boolean isMirror;
+
@Option(name = "--quiet", usage = "usage_quiet")
private Boolean quiet;
@@ -103,7 +106,7 @@ class Clone extends AbstractFetchCommand implements CloneCommand.Callback {
if (localName == null) {
try {
localName = uri.getHumanishName();
- if (isBare) {
+ if (isBare || isMirror) {
localName = localName + Constants.DOT_GIT_EXT;
}
localNameF = new File(SystemReader.getInstance().getProperty(
@@ -120,6 +123,7 @@ class Clone extends AbstractFetchCommand implements CloneCommand.Callback {
CloneCommand command = Git.cloneRepository();
command.setURI(sourceUri).setRemote(remoteName).setBare(isBare)
+ .setMirror(isMirror)
.setNoCheckout(noCheckout).setBranch(branch)
.setCloneSubmodules(cloneSubmodules);