Skip to content
Open
Changes from all commits
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
4 changes: 2 additions & 2 deletions include/cppgit2/diff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class diff : public libgit2_api {
// the delta.
class hunk : public libgit2_api {
public:
hunk(const git_diff_hunk *c_ptr) : c_struct_(*c_ptr) {}
hunk(const git_diff_hunk *c_ptr) : c_struct_(c_ptr ? *c_ptr : git_diff_hunk{0}) {}

// Starting line number in old_file
int old_start() const { return c_struct_.old_start; }
Expand Down Expand Up @@ -898,4 +898,4 @@ ENABLE_BITMASK_OPERATORS(diff::stats::format);
ENABLE_BITMASK_OPERATORS(diff::format_email_flag);
ENABLE_BITMASK_OPERATORS(diff::find_flag);

} // namespace cppgit2
} // namespace cppgit2