You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/07/15 13:24:42 UTC

[31/50] [abbrv] git commit: shorten object names

shorten object names


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/64f12126
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/64f12126
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/64f12126

Branch: refs/heads/master
Commit: 64f121260b858e763a8cf9f9161bedaff3ab268f
Parents: 0a62a24
Author: imod <do...@fortysix.ch>
Authored: Fri Jul 12 08:23:09 2013 +0200
Committer: imod <do...@fortysix.ch>
Committed: Fri Jul 12 08:23:09 2013 +0200

----------------------------------------------------------------------
 .../git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-scm/blob/64f12126/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java b/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
index 07b2e7d..0d98625 100644
--- a/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
+++ b/src/main/java/org/apache/maven/scm/provider/git/jgit/command/remoteinfo/JGitRemoteInfoCommand.java
@@ -35,6 +35,7 @@ import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.api.LsRemoteCommand;
 import org.eclipse.jgit.lib.Ref;
+import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.transport.CredentialsProvider;
 
 /**
@@ -61,17 +62,17 @@ public class JGitRemoteInfoCommand
                 git.lsRemote().setRemote( repo.getPushUrl() ).setCredentialsProvider( credentials );
 
             Map<String, String> tag = new HashMap<String, String>();
-            Collection<Ref> allTags = lsCommand.setHeads( false ).call();
+            Collection<Ref> allTags = lsCommand.setHeads( false ).setTags(true).call();
             for ( Ref ref : allTags )
             {
-                tag.put( ref.getName(), ref.getObjectId().name() );
+                tag.put( Repository.shortenRefName(ref.getName()), ref.getObjectId().name() );
             }
 
             Map<String, String> heads = new HashMap<String, String>();
-            Collection<Ref> allHeads = lsCommand.setTags( false ).call();
+            Collection<Ref> allHeads = lsCommand.setHeads(true).setTags( false ).call();
             for ( Ref ref : allHeads )
             {
-                heads.put( ref.getName(), ref.getObjectId().name() );
+                heads.put( Repository.shortenRefName(ref.getName()), ref.getObjectId().name() );
             }
 
             return new RemoteInfoScmResult( "JGit remoteinfo", heads, tag );