]> git.proxmox.com Git - libgit2.git/commit - src/checkout.h
iterator: submodules are determined by an index or tree
authorCarlos Martín Nieto <cmn@dwim.me>
Thu, 6 Nov 2014 15:16:46 +0000 (16:16 +0100)
committerCarlos Martín Nieto <cmn@dwim.me>
Fri, 7 Nov 2014 07:33:27 +0000 (08:33 +0100)
commit62a617dc683c1e73eebd0e1b6209f76748e67ed4
tree5893fe2b801d96825582d8a461b50e80f4a2a43a
parentf1a7906fdf0657fba88449bdab07237847f36670
iterator: submodules are determined by an index or tree

We cannot know from looking at .gitmodules whether a directory is a
submodule or not. We need the index or tree we are comparing against to
tell us. Otherwise we have to assume the entry in .gitmodules is stale
or otherwise invalid.

Thus we pass the index of the repository into the workdir iterator, even
if we do not want to compare against it. This follows what git does,
which even for `git diff <tree>`, it will consider staged submodules as
such.
src/checkout.c
src/checkout.h
src/diff.c
src/index.c
src/iterator.c
src/iterator.h
src/pathspec.c
tests/diff/iterator.c
tests/repo/iterator.c
tests/submodule/status.c
tests/threads/iterator.c