|
|
@ -137,13 +137,12 @@ public class AddCommand extends GitCommand<DirCache> { |
|
|
|
if (filepatterns.contains(".")) //$NON-NLS-1$
|
|
|
|
if (filepatterns.contains(".")) //$NON-NLS-1$
|
|
|
|
addAll = true; |
|
|
|
addAll = true; |
|
|
|
|
|
|
|
|
|
|
|
ObjectInserter inserter = repo.newObjectInserter(); |
|
|
|
try (ObjectInserter inserter = repo.newObjectInserter(); |
|
|
|
try { |
|
|
|
final TreeWalk tw = new TreeWalk(repo)) { |
|
|
|
dc = repo.lockDirCache(); |
|
|
|
dc = repo.lockDirCache(); |
|
|
|
DirCacheIterator c; |
|
|
|
DirCacheIterator c; |
|
|
|
|
|
|
|
|
|
|
|
DirCacheBuilder builder = dc.builder(); |
|
|
|
DirCacheBuilder builder = dc.builder(); |
|
|
|
final TreeWalk tw = new TreeWalk(repo); |
|
|
|
|
|
|
|
tw.addTree(new DirCacheBuildIterator(builder)); |
|
|
|
tw.addTree(new DirCacheBuildIterator(builder)); |
|
|
|
if (workingTreeIterator == null) |
|
|
|
if (workingTreeIterator == null) |
|
|
|
workingTreeIterator = new FileTreeIterator(repo); |
|
|
|
workingTreeIterator = new FileTreeIterator(repo); |
|
|
@ -212,7 +211,6 @@ public class AddCommand extends GitCommand<DirCache> { |
|
|
|
throw new JGitInternalException( |
|
|
|
throw new JGitInternalException( |
|
|
|
JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e); |
|
|
|
JGitText.get().exceptionCaughtDuringExecutionOfAddCommand, e); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
inserter.release(); |
|
|
|
|
|
|
|
if (dc != null) |
|
|
|
if (dc != null) |
|
|
|
dc.unlock(); |
|
|
|
dc.unlock(); |
|
|
|
} |
|
|
|
} |
|
|
|