You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2013/09/11 00:05:07 UTC
svn commit: r1521663 -
/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
Author: hboutemy
Date: Tue Sep 10 22:05:06 2013
New Revision: 1521663
URL: http://svn.apache.org/r1521663
Log:
[MPIR-290] improve git support: remove directory info (after '.git') for "git clone"
Modified:
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java?rev=1521663&r1=1521662&r2=1521663&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java Tue Sep 10 22:05:06 2013
@@ -529,6 +529,15 @@ public class ScmReport
private void gitClone( String url )
{
+ int index = url.indexOf( ".git/" );
+ if ( index > 0 )
+ {
+ log.warn( "Wrong effective scm url " + url + ": removing " + url.substring( index + 4 )
+ + " in report, but this should be configured in pom.xml." );
+
+ url = url.substring( 0, index + 4 );
+ }
+
boolean head = StringUtils.isEmpty( scmTag ) || "HEAD".equals( scmTag );
verbatimText( "$ git clone " + ( head ? "" : ( "--branch " + scmTag + ' ' ) ) + url );
}