tests-clar/index/addall.c


Log

Author Commit Date CI Message
Russell Belfer 7863523a 2013-06-19T15:54:19 Add tests and fix use of freed memory This adds some tests for updating the index and having it remove items to make sure that the iteration over the index still works even as earlier items are removed. In testing with valgrind, this found a path that would use the path string from the index entry after it had been freed. The bug fix is simply to copy the path of the index entry before doing any actual index manipulation.
Russell Belfer f30fff45 2013-06-19T15:27:25 Add index pathspec-based operations This adds three new public APIs for manipulating the index: 1. `git_index_add_all` is similar to `git add -A` and will add files in the working directory that match a pathspec to the index while honoring ignores, etc. 2. `git_index_remove_all` removes files from the index that match a pathspec. 3. `git_index_update_all` updates entries in the index based on the current contents of the working directory, either added the new information or removing the entry from the index.