Skip to content

Commit d232da9

Browse files
committed
integrate git_strarray wrapper
1 parent 75f8c47 commit d232da9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/wrapper/index_wrapper.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ void index_wrapper::add_all()
2929

3030
void index_wrapper::add_impl(std::vector<std::string> patterns)
3131
{
32-
git_strarray array{new char*[patterns.size()], patterns.size()};
33-
for (size_t i=0; i<patterns.size(); ++i)
34-
{
35-
array.strings[i] = const_cast<char*>(patterns[i].c_str());
36-
}
37-
throwIfError(git_index_add_all(*this, &array, 0, NULL, NULL));
32+
git_strarray_wrapper array=git_strarray_wrapper(patterns);
33+
throwIfError(git_index_add_all(*this, array, 0, NULL, NULL));
3834
throwIfError(git_index_write(*this));
3935
}

0 commit comments

Comments
 (0)