Skip to content

Added git_index_add_all - #344

Merged
jdavid merged 3 commits into
libgit2:masterfrom
MartinStolle:master
Feb 16, 2014
Merged

jdavid merged 3 commits into
libgit2:masterfrom
MartinStolle:master

Conversation

@MartinStolle

Copy link
Copy Markdown
Contributor

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

Leonardo Rhodes added 2 commits February 12, 2014 21:47
Moved git strarray conversion to utils
@jdavid

jdavid commented Feb 13, 2014

Copy link
Copy Markdown
Member

It looks good, just please add unit tests. Thanks!

@MartinStolle

Copy link
Copy Markdown
Contributor Author

Alright, added unit test.

@jdavid
jdavid merged commit 1a17256 into libgit2:master Feb 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants