diff options
author | Martin von Zweigbergk <martinvonz@gmail.com> | 2013-01-14 21:47:33 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-15 09:38:06 -0800 |
commit | 10746a361689aaa1aa98b8d4e7fb3b8463391864 (patch) | |
tree | 02acfb88b6efec2661c858a5ab8d6596d4894e53 /t/t5521-pull-options.sh | |
parent | 44fe83502edf5391bb3a5997cab01794b4568062 (diff) | |
download | git-10746a361689aaa1aa98b8d4e7fb3b8463391864.tar.gz |
reset $pathspec: no need to discard index
Since 34110cd (Make 'unpack_trees()' have a separate source and
destination index, 2008-03-06), the index no longer gets clobbered by
do_diff_cache() and we can remove the code for discarding and
re-reading it.
There are two paths to update_index_refresh() from cmd_reset(), but on
both paths, either read_cache() or read_cache_unmerged() will have
been called, so the call to read_cache() in this method is redundant
(although practically free).
This speeds up "git reset -- ." a little on the linux-2.6 repo (best
of five, warm cache):
Before After
real 0m0.093s 0m0.080s
user 0m0.040s 0m0.020s
sys 0m0.050s 0m0.050s
Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5521-pull-options.sh')
0 files changed, 0 insertions, 0 deletions