]> source.dussan.org Git - jgit.git/commit
DirCacheCheckout: load WorkingTreeOptions only once 81/195181/2
authorThomas Wolf <twolf@apache.org>
Sun, 14 Aug 2022 14:34:50 +0000 (16:34 +0200)
committerMatthias Sohn <matthias.sohn@sap.com>
Sun, 14 Aug 2022 19:33:19 +0000 (21:33 +0200)
commitb255eb0fb6ab9c7487423083e8df9b1e373bc37e
tree085ffc3bb03717ad7c91b16296d485685789822e
parent134ee334fb22410623972fa972f60bff38b38ca8
DirCacheCheckout: load WorkingTreeOptions only once

Previous code loaded the WorkingTreeOptions afresh for every single
file being checked out. This checked the git config (all three files,
repo, user and system config) for having been modified every time.

These checks can be costly, for instance on Windows, or if one of the
three config files is not on a local disk, or on an otherwise slow
storage.

Improve this by loading the options and thus checking the git config
only once before the checkout.

Bug: 579715
Change-Id: I21cd5a808f9d90b5ca2d022f91f0eeb8ca26091c
Signed-off-by: Thomas Wolf <twolf@apache.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CheckoutCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/api/StashApplyCommand.java
org.eclipse.jgit/src/org/eclipse/jgit/dircache/DirCacheCheckout.java
org.eclipse.jgit/src/org/eclipse/jgit/util/WorkTreeUpdater.java