diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2018-04-01 14:01:52 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2018-04-01 14:11:34 +0200 |
commit | 2a6d0956f0fb6e4c0b9ff2455b4449701bd8e6a2 (patch) | |
tree | 598c73f0c6087b158cd714d56bba881c2788a67f /tests/diff/binary.c | |
parent | dc27772ce2b3d9e34c5e97fb0eb010e21c96ee33 (diff) | |
download | libgit2-2a6d0956f0fb6e4c0b9ff2455b4449701bd8e6a2.tar.gz |
revwalk: avoid walking the entire history when output is unsorted
As part of reducing our divergence from git, its code for revwalk was ported
into our codebase. A detail about when to limit the list was lost and we ended
up always calling that code.
Limiting the list means performing the walk and creating the final list of
commits to be output during the preparation stage. This is unavoidable when
sorting and when there are negative refs.
We did this even when asked for unsorted output with no negative refs, which you
might do to retrieve something like the "last 10 commits on HEAD" for a
nominally unsorted meaning of "last".
This commit adds and sets a flag indicating when we do need to limit the list,
letting us avoid doing so when we can. The previously mentioned query thus no
longer loads the entire history of the project during the prepare stage, but
loads it iteratively during the walk.
Diffstat (limited to 'tests/diff/binary.c')
0 files changed, 0 insertions, 0 deletions