aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
index 36812c03a4..055b48a157 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java
@@ -34,6 +34,9 @@ class LsRemote extends TextBuiltin {
@Option(name = "--timeout", metaVar = "metaVar_service", usage = "usage_abortConnectionIfNoActivity")
int timeout = -1;
+ @Option(name = "--symref", usage = "usage_lsRemoteSymref")
+ private boolean symref;
+
@Argument(index = 0, metaVar = "metaVar_uriish", required = true)
private String remote;
@@ -47,6 +50,9 @@ class LsRemote extends TextBuiltin {
try {
refs.addAll(command.call());
for (Ref r : refs) {
+ if (symref && r.isSymbolic()) {
+ show(r.getTarget(), r.getName());
+ }
show(r.getObjectId(), r.getName());
if (r.getPeeledObjectId() != null) {
show(r.getPeeledObjectId(), r.getName() + "^{}"); //$NON-NLS-1$
@@ -70,4 +76,13 @@ class LsRemote extends TextBuiltin {
outw.print(name);
outw.println();
}
+
+ private void show(Ref ref, String name)
+ throws IOException {
+ outw.print("ref: ");
+ outw.print(ref.getName());
+ outw.print('\t');
+ outw.print(name);
+ outw.println();
+ }
}