Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
integrate git_strarray wrapper
  • Loading branch information
SandrineP committed Jul 17, 2025
commit d232da9ff04bd28d33da62fa4f88c0978f5d284f
8 changes: 2 additions & 6 deletions src/wrapper/index_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ void index_wrapper::add_all()

void index_wrapper::add_impl(std::vector<std::string> patterns)
{
git_strarray array{new char*[patterns.size()], patterns.size()};
for (size_t i=0; i<patterns.size(); ++i)
{
array.strings[i] = const_cast<char*>(patterns[i].c_str());
}
throwIfError(git_index_add_all(*this, &array, 0, NULL, NULL));
git_strarray_wrapper array=git_strarray_wrapper(patterns);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
git_strarray_wrapper array=git_strarray_wrapper(patterns);
git_strarray_wrapper array{patterns};

throwIfError(git_index_add_all(*this, array, 0, NULL, NULL));
throwIfError(git_index_write(*this));
}