summaryrefslogtreecommitdiff
path: root/notes.h
diff options
context:
space:
mode:
authorBen Peart <Ben.Peart@microsoft.com>2018-08-16 18:27:11 +0000
committerJunio C Hamano <gitster@pobox.com>2018-08-16 11:54:57 -0700
commitfa655d8411cc2d7ffcf898e53a1493c737d7de68 (patch)
tree80a88418d738aa4701155f7c3cf3cc38b6836052 /notes.h
parentffc6fa0e396238de3a30623912980263b4f283ab (diff)
downloadgit-fa655d8411cc2d7ffcf898e53a1493c737d7de68.tar.gz
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 'notes.h')
0 files changed, 0 insertions, 0 deletions