summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-07-20 07:56:06 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-07-21 09:00:37 (GMT)
commitdba07411da8debf9e39bf8d28f642b09c5794aff (patch)
tree51fbdef4f9db9ccfd33ee6ac849d9ec1661f77fd /lib
parenteea1ab6e23db4c929500fb11464a438b0ba569f0 (diff)
downloadgit-dba07411da8debf9e39bf8d28f642b09c5794aff.zip
git-dba07411da8debf9e39bf8d28f642b09c5794aff.tar.gz
git-dba07411da8debf9e39bf8d28f642b09c5794aff.tar.bz2
git-gui: Skip unnecessary read-tree work during checkout
I totally missed this obvious optimization in the checkout code path. If our current repository HEAD is actually at the commit we are moving to, and we agreed to perform this switch earlier, then we have no files to update in the working directory and any stale mtimes are simply not of consequence right now. We can pretend like we ran a read-tree and skip right into the post-read-tree work, such as updating the branch and setting the symbolic-ref. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/checkout_op.tcl4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/checkout_op.tcl b/lib/checkout_op.tcl
index 554c107..cb04d1e 100644
--- a/lib/checkout_op.tcl
+++ b/lib/checkout_op.tcl
@@ -266,7 +266,9 @@ The rescan will be automatically started now.
return
}
- if {[is_config_true gui.trustmtime]} {
+ if {$curHEAD eq $new_hash} {
+ _after_readtree $this
+ } elseif {[is_config_true gui.trustmtime]} {
_readtree $this
} else {
ui_status {Refreshing file status...}