|
|
@ -340,30 +340,22 @@ public abstract class WorkingTreeIterator extends AbstractTreeIterator { |
|
|
|
* @return non-null submodule id |
|
|
|
* @return non-null submodule id |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
protected byte[] idSubmodule(File directory, Entry e) { |
|
|
|
protected byte[] idSubmodule(File directory, Entry e) { |
|
|
|
final Repository submoduleRepo; |
|
|
|
try (Repository submoduleRepo = SubmoduleWalk.getSubmoduleRepository( |
|
|
|
try { |
|
|
|
directory, e.getName(), |
|
|
|
submoduleRepo = SubmoduleWalk.getSubmoduleRepository(directory, |
|
|
|
repository != null ? repository.getFS() : FS.DETECTED)) { |
|
|
|
e.getName(), |
|
|
|
if (submoduleRepo == null) { |
|
|
|
repository != null ? repository.getFS() : FS.DETECTED); |
|
|
|
|
|
|
|
} catch (IOException exception) { |
|
|
|
|
|
|
|
return zeroid; |
|
|
|
return zeroid; |
|
|
|
} |
|
|
|
} |
|
|
|
if (submoduleRepo == null) |
|
|
|
ObjectId head = submoduleRepo.resolve(Constants.HEAD); |
|
|
|
return zeroid; |
|
|
|
if (head == null) { |
|
|
|
|
|
|
|
|
|
|
|
final ObjectId head; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
head = submoduleRepo.resolve(Constants.HEAD); |
|
|
|
|
|
|
|
} catch (IOException exception) { |
|
|
|
|
|
|
|
return zeroid; |
|
|
|
return zeroid; |
|
|
|
} finally { |
|
|
|
|
|
|
|
submoduleRepo.close(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (head == null) |
|
|
|
byte[] id = new byte[Constants.OBJECT_ID_LENGTH]; |
|
|
|
return zeroid; |
|
|
|
|
|
|
|
final byte[] id = new byte[Constants.OBJECT_ID_LENGTH]; |
|
|
|
|
|
|
|
head.copyRawTo(id, 0); |
|
|
|
head.copyRawTo(id, 0); |
|
|
|
return id; |
|
|
|
return id; |
|
|
|
|
|
|
|
} catch (IOException exception) { |
|
|
|
|
|
|
|
return zeroid; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static final byte[] digits = { '0', '1', '2', '3', '4', '5', '6', |
|
|
|
private static final byte[] digits = { '0', '1', '2', '3', '4', '5', '6', |
|
|
|