in wagon-providers/wagon-scm/src/main/java/org/apache/maven/wagon/providers/scm/ScmWagon.java [574:617]
private int addFiles( ScmProvider scmProvider, ScmRepository scmRepository, File basedir, String scmFilePath )
throws ScmException
{
int addedFiles = 0;
File scmFile = new File( basedir, scmFilePath );
if ( scmFilePath.length() != 0 )
{
AddScmResult result =
scmProvider.add( scmRepository, new ScmFileSet( basedir, new File( scmFilePath ) ), mkBinaryFlag() );
/*
* TODO dirty fix to work around files with property svn:eol-style=native if a file has that property, first
* time file is added it fails, second time it succeeds the solution is check if the scm provider is svn and
* unset that property when the SCM API allows it
*/
if ( !result.isSuccess() )
{
result =
scmProvider.add( scmRepository, new ScmFileSet( basedir, new File( scmFilePath ) ),
mkBinaryFlag() );
}
addedFiles = result.getAddedFiles().size();
}
String reservedScmFile = scmProvider.getScmSpecificFilename();
if ( scmFile.isDirectory() )
{
for ( File file : scmFile.listFiles() )
{
if ( reservedScmFile != null && !reservedScmFile.equals( file.getName() ) )
{
addedFiles += addFiles( scmProvider, scmRepository, basedir,
( scmFilePath.length() == 0 ? "" : scmFilePath + "/" )
+ file.getName() );
}
}
}
return addedFiles;
}