Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added git_index_add_all #344

Merged
merged 3 commits into from
Feb 16, 2014
Merged

Added git_index_add_all #344

merged 3 commits into from
Feb 16, 2014

Conversation

MartinStolle
Copy link
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
Copy link
Member

jdavid commented Feb 13, 2014

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

@MartinStolle
Copy link
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants