| Name |
Last commit
|
Last update |
|---|---|---|
| deps/zlib | ||
| include | ||
| src | ||
| tests | ||
| .HEADER | ||
| .gitignore | ||
| CMakeLists.txt | ||
| CONVENTIONS | ||
| COPYING | ||
| README.md | ||
| api.doxygen | ||
| git.git-authors | ||
| libgit2.pc.in | ||
| waf | ||
| wscript |
The current behaviour of git_index_open{bare,inrepo}() is unexpected.
When an index is opened, an in-memory index object is created that is
linked to the index discovered by git_repository_open(). However, this
index object is empty, as the on-disk index is not read. To fully open
the on-disk index file, git_index_read() has to be called. This leads to
confusing behaviour. Consider the following code:
git_index *idx;
git_index_open_inrepo(&idx, repo);
git_index_write(idx);
You would expect this to have no effect, as the index is never
ostensibly manipulated. However, what actually happens is that the index
entries are removed from the on-disk index because the empty in-memory
index object created by open_inrepo() is written back to the disk.
This patch reads the index after opening it.
| Name |
Last commit
|
Last update |
|---|---|---|
| deps/zlib | Loading commit data... | |
| include | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| .HEADER | Loading commit data... | |
| .gitignore | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONVENTIONS | Loading commit data... | |
| COPYING | Loading commit data... | |
| README.md | Loading commit data... | |
| api.doxygen | Loading commit data... | |
| git.git-authors | Loading commit data... | |
| libgit2.pc.in | Loading commit data... | |
| waf | Loading commit data... | |
| wscript | Loading commit data... |