diff options
author | Ben Peart <Ben.Peart@microsoft.com> | 2018-08-16 18:27:11 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-08-16 11:54:57 -0700 |
commit | fa655d8411cc2d7ffcf898e53a1493c737d7de68 (patch) | |
tree | 80a88418d738aa4701155f7c3cf3cc38b6836052 /line-log.h | |
parent | Fourth batch for 2.19 cycle (diff) | |
download | tgif-fa655d8411cc2d7ffcf898e53a1493c737d7de68.tar.xz |
checkout: optimize "git checkout -b <new_branch>"
Skip merging the commit, updating the index and working directory if and
only if we are creating a new branch via "git checkout -b <new_branch>."
Any other checkout options will still go through the former code path.
If sparse_checkout is on, require the user to manually opt in to this
optimzed behavior by setting the config setting checkout.optimizeNewBranch
to true as we will no longer update the skip-worktree bit in the index, nor
add/remove files in the working directory to reflect the current sparse
checkout settings.
For comparison, running "git checkout -b <new_branch>" on a large repo takes:
14.6 seconds - without this patch
0.3 seconds - with this patch
Signed-off-by: Ben Peart <Ben.Peart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'line-log.h')
0 files changed, 0 insertions, 0 deletions