@@ -726,6 +726,9 @@ private static final int addZipDir(final ZipOutputStream out, final Path root, f
726
726
final ProjectProperties props , DirectoryStream .Filter <Path > filter ) throws IOException
727
727
{
728
728
int addedFiles = 0 ;
729
+
730
+ boolean skipRepositories = Boolean .parseBoolean (pluginProps .getProperty (PROPERTY_PACK_OFFLINE , FALSE ));
731
+
729
732
try (DirectoryStream <Path > stream = Files .newDirectoryStream (dir , filter )) {
730
733
for (Path child : stream ) {
731
734
final Path childPath = child .getFileName ();
@@ -737,6 +740,11 @@ private static final int addZipDir(final ZipOutputStream out, final Path root, f
737
740
continue ;
738
741
}
739
742
743
+ if (skipRepositories && (childPath .endsWith (".repositories" ) || childPath .endsWith (".git" )
744
+ || childPath .endsWith (".svn" ))) {
745
+ continue ;
746
+ }
747
+
740
748
if (root == null && childPath .endsWith (OConsts .FILE_PROJECT )) {
741
749
// Special case - when a project is opened, the project file is locked and
742
750
// can't be copied directly. To avoid this, we make a temp copy.
@@ -745,8 +753,7 @@ private static final int addZipDir(final ZipOutputStream out, final Path root, f
745
753
File tmpProjectFile = File .createTempFile ("omt" , OConsts .BACKUP_EXTENSION ,
746
754
props .getProjectRootDir ());
747
755
748
- boolean skipRepositories = Boolean .parseBoolean (pluginProps .getProperty (PROPERTY_PACK_OFFLINE , FALSE ));
749
-
756
+
750
757
try {
751
758
ProjectFileStorage .writeProjectFile (props , tmpProjectFile , skipRepositories );
752
759
} catch (Exception e ) {
0 commit comments