File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -325,7 +325,7 @@ size_t repository_wrapper::shallow_depth_from_head() const
325325 commit_list_wrapper parent_list ({});
326326 std::vector<size_t > has_parent_list;
327327
328- for (size_t i = 0 ; commits_list.size (); i++)
328+ for (size_t i = 0 ; i < commits_list.size (); i++)
329329 {
330330 const commit_wrapper& commit = commits_list[i];
331331 size_t depth = depth_list[i];
@@ -356,7 +356,8 @@ size_t repository_wrapper::shallow_depth_from_head() const
356356 }
357357 depth_list = temp_depth_list;
358358 commits_list = commit_list_wrapper (std::move (temp_commits_list));
359- has_parent = *std::max_element (has_parent_list.begin (), has_parent_list.end ());
359+ auto has_parent_iter = std::max_element (has_parent_list.begin (), has_parent_list.end ());
360+ has_parent = has_parent_iter != has_parent_list.end () ? *has_parent_iter : 0u ;
360361 }
361362
362363 depth = *std::max_element (final_depths.begin (), final_depths.end ());
You can’t perform that action at this time.
0 commit comments