]> git.proxmox.com Git - libgit2.git/commit
iterator: saner pathlist matching for idx iterator
authorEdward Thomson <ethomson@edwardthomson.com>
Sun, 30 Aug 2015 23:25:47 +0000 (19:25 -0400)
committerEdward Thomson <ethomson@microsoft.com>
Mon, 31 Aug 2015 15:48:06 +0000 (11:48 -0400)
commitd53c8880696856d695b0979c55136b06e45d6fbb
treec79a58c80d3a94f94a77600dfc1dae7ec22011bc
parent56ed415a24d41e83169ac17f468a540260bd08ff
iterator: saner pathlist matching for idx iterator

Some nicer refactoring for index iteration walks.

The index iterator doesn't binary search through the pathlist space,
since it lacks directory entries, and would have to binary search
each index entry and all its parents (eg, when presented with an index
entry of `foo/bar/file.c`, you would have to look in the pathlist for
`foo/bar/file.c`, `foo/bar` and `foo`).  Since the index entries and the
pathlist are both nicely sorted, we walk the index entries in lockstep
with the pathlist like we do for other iteration/diff/merge walks.
src/iterator.c
src/iterator.h
tests/diff/workdir.c
tests/repo/iterator.c