Optimize DirCacheCheckout
When checking out a tree, files that are identical to the file in the current index and working directory don't need to be updated. Change-Id: I9e025a53facd42410796eae821baaeff684a25c5 Signed-off-by: Chris Aniszczyk <caniszczyk@gmail.com>
This commit is contained in:
parent
e10808e658
commit
07cae6e6c1
|
@ -273,8 +273,13 @@ public void prescanOneTree()
|
||||||
void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i,
|
void processEntry(CanonicalTreeParser m, DirCacheBuildIterator i,
|
||||||
WorkingTreeIterator f) {
|
WorkingTreeIterator f) {
|
||||||
if (m != null) {
|
if (m != null) {
|
||||||
|
if (i == null || f == null || !m.idEqual(i)
|
||||||
|
|| f.isModified(i.getDirCacheEntry(), true,
|
||||||
|
config_filemode(), repo.getFS())) {
|
||||||
update(m.getEntryPathString(), m.getEntryObjectId(),
|
update(m.getEntryPathString(), m.getEntryObjectId(),
|
||||||
m.getEntryFileMode());
|
m.getEntryFileMode());
|
||||||
|
} else
|
||||||
|
keep(i.getDirCacheEntry());
|
||||||
} else {
|
} else {
|
||||||
if (f != null) {
|
if (f != null) {
|
||||||
if (walk.isDirectoryFileConflict()) {
|
if (walk.isDirectoryFileConflict()) {
|
||||||
|
|
Loading…
Reference in New Issue