@ -94,8 +94,6 @@ public class SubmoduleWalk {
try {
try {
DirCache index = repository . readDirCache ( ) ;
DirCache index = repository . readDirCache ( ) ;
generator . setTree ( new DirCacheIterator ( index ) ) ;
generator . setTree ( new DirCacheIterator ( index ) ) ;
generator . setRootTree ( new DirCacheIterator ( index ) ) ;
generator . useWorkingTree = true ;
} catch ( IOException e ) {
} catch ( IOException e ) {
generator . release ( ) ;
generator . release ( ) ;
throw e ;
throw e ;
@ -304,8 +302,6 @@ public class SubmoduleWalk {
private String path ;
private String path ;
private boolean useWorkingTree ;
/ * *
/ * *
* Create submodule generator
* Create submodule generator
*
*
@ -388,7 +384,14 @@ public class SubmoduleWalk {
* @throws ConfigInvalidException
* @throws ConfigInvalidException
* /
* /
public SubmoduleWalk loadModulesConfig ( ) throws IOException , ConfigInvalidException {
public SubmoduleWalk loadModulesConfig ( ) throws IOException , ConfigInvalidException {
if ( rootTree ! = null ) {
if ( rootTree = = null ) {
File modulesFile = new File ( repository . getWorkTree ( ) ,
Constants . DOT_GIT_MODULES ) ;
FileBasedConfig config = new FileBasedConfig ( modulesFile ,
repository . getFS ( ) ) ;
config . load ( ) ;
modulesConfig = config ;
} else {
TreeWalk configWalk = new TreeWalk ( repository ) ;
TreeWalk configWalk = new TreeWalk ( repository ) ;
try {
try {
configWalk . addTree ( rootTree ) ;
configWalk . addTree ( rootTree ) ;
@ -411,10 +414,7 @@ public class SubmoduleWalk {
return this ;
return this ;
}
}
}
}
if ( ! useWorkingTree ) {
modulesConfig = new Config ( ) ;
modulesConfig = new Config ( ) ;
return this ;
}
} finally {
} finally {
if ( idx > 0 )
if ( idx > 0 )
rootTree . next ( idx ) ;
rootTree . next ( idx ) ;
@ -423,16 +423,6 @@ public class SubmoduleWalk {
configWalk . release ( ) ;
configWalk . release ( ) ;
}
}
}
}
if ( repository . isBare ( ) ) {
modulesConfig = new Config ( ) ;
} else {
File modulesFile = new File ( repository . getWorkTree ( ) ,
Constants . DOT_GIT_MODULES ) ;
FileBasedConfig config = new FileBasedConfig ( modulesFile ,
repository . getFS ( ) ) ;
config . load ( ) ;
modulesConfig = config ;
}
return this ;
return this ;
}
}