aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/submodule
diff options
context:
space:
mode:
authorMarc Strapetz <marc.strapetz@syntevo.com>2017-12-13 22:46:47 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2017-12-30 00:27:14 +0100
commit8779092716f096278ef7c763e2707111c897f82e (patch)
tree6e632fc53da281e417b53c0308497d9db0806393 /org.eclipse.jgit/src/org/eclipse/jgit/submodule
parentde49edbffb15bbc4daa39b3387dce47d71bc8fef (diff)
downloadjgit-8779092716f096278ef7c763e2707111c897f82e.tar.gz
jgit-8779092716f096278ef7c763e2707111c897f82e.zip
WorkingTreeIterator should pass FS to submodules
Change-Id: I4b7bc6bab449b9e3aebba8170788ff9e4a04195a Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/submodule')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java22
1 files changed, 20 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java
index 0e4cd904cd..2314cf10df 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/submodule/SubmoduleWalk.java
@@ -223,7 +223,8 @@ public class SubmoduleWalk implements AutoCloseable {
*/
public static Repository getSubmoduleRepository(final Repository parent,
final String path) throws IOException {
- return getSubmoduleRepository(parent.getWorkTree(), path);
+ return getSubmoduleRepository(parent.getWorkTree(), path,
+ parent.getFS());
}
/**
@@ -238,6 +239,23 @@ public class SubmoduleWalk implements AutoCloseable {
*/
public static Repository getSubmoduleRepository(final File parent,
final String path) throws IOException {
+ return getSubmoduleRepository(parent, path, FS.DETECTED);
+ }
+
+ /**
+ * Get submodule repository at path, using the specified file system
+ * abstraction
+ *
+ * @param parent
+ * @param path
+ * @param fs
+ * the file system abstraction to be used
+ * @return repository or null if repository doesn't exist
+ * @throws IOException
+ * @since 4.10
+ */
+ public static Repository getSubmoduleRepository(final File parent,
+ final String path, FS fs) throws IOException {
File subWorkTree = new File(parent, path);
if (!subWorkTree.isDirectory())
return null;
@@ -245,7 +263,7 @@ public class SubmoduleWalk implements AutoCloseable {
try {
return new RepositoryBuilder() //
.setMustExist(true) //
- .setFS(FS.DETECTED) //
+ .setFS(fs) //
.setWorkTree(workTree) //
.build();
} catch (RepositoryNotFoundException e) {