libgit2/pygit2 — pull request #344 by LeonardoRhodes (2014-02-12 21:29:08+00:00)
Title: Added git_index_add_all

Hello,

noticed the method (http://libgit2.github.com/libgit2/#HEAD/group/index/git_index_add_all) is missing and added it. Flags, callback and payload are missing as argument though, but it should work for most use cases.

See example below:

>>> print repo.status()
{'config.h': 128, 'TODO.txt': 128, 'commit.h': 128, 'diff.c': 128, 'branch.c': 128, 'commit.c': 128, 'README.rst': 128, 'COPYING': 128, 'blame.c': 128, 'how-to.txt': 128, 'blob.h': 128, 'blame.h': 128}
>>> repo.index.add_all(['README.rst', 'COPYING'])
>>> print repo.status()
{'config.h': 128, 'TODO.txt': 128, 'commit.h': 128, 'diff.c': 128, 'branch.c': 128, 'commit.c': 128, 'README.rst': 1, 'COPYING': 1, 'blame.c': 128, 'how-to.txt': 128, 'blob.h': 128, 'blame.h': 128}
>>> repo.index.add_all(['TODO.txt', '*.h'])
>>> print repo.status()
{'config.h': 1, 'TODO.txt': 1, 'commit.h': 1, 'diff.c': 128, 'branch.c': 128, 'commit.c': 128, 'README.rst': 1, 'COPYING': 1, 'blame.c': 128, 'how-to.txt': 128, 'blob.h': 1, 'blame.h': 1}

Let me know if I need to change or add anything.

Kind regards