diff options
author | Javi Fontan <jfontan@gmail.com> | 2018-05-14 17:16:16 +0200 |
---|---|---|
committer | Javi Fontan <jfontan@gmail.com> | 2018-05-14 17:16:16 +0200 |
commit | 939793b42974c12abf2d2b65facee489004a9e06 (patch) | |
tree | 9e8386962b8000781c851dc9367839d9e8d2ce65 /options_test.go | |
parent | e63b032e91ce35e0ecd5f27d43be655625e8af36 (diff) | |
download | go-git-939793b42974c12abf2d2b65facee489004a9e06.tar.gz |
git: remote, Do not iterate all references on update.
The current code iterates all the references in the remote to check if
they match the refspec. This is OK when the refspec is a wildcard but
is a waste of time when they are not.
A hash with references is generated for fast access before starting the
update and used only when the refspec is not a wildcard.
In a repository with 7800 references this meant 7800 * 7800 checks. With
the current code it took 8m30s to update the references. With the new
code it takes less than 0.5s.
References are already extensively tested in remote_test.go.
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Diffstat (limited to 'options_test.go')
0 files changed, 0 insertions, 0 deletions