77 const wxString& aBaseRef,
78 const wxString& aHeadRef )
80 std::vector<CHANGED_FILE>
result;
88 if( !baseTree || !headTree )
91 git_diff* diff =
nullptr;
92 git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
94 if( git_diff_tree_to_tree( &diff, aRepo, baseTree.get(), headTree.get(), &opts ) != 0 )
96 wxLogTrace(
traceGit,
"git_diff_tree_to_tree failed: %s",
104 git_diff_find_options findOpts = GIT_DIFF_FIND_OPTIONS_INIT;
105 findOpts.flags = GIT_DIFF_FIND_RENAMES | GIT_DIFF_FIND_COPIES;
106 git_diff_find_similar( diff, &findOpts );
108 result.reserve( git_diff_num_deltas( diff ) );
111 [&
result](
const git_diff_delta& aDelta )
114 entry.
status = deltaStatusToEnum( aDelta.status );
115 entry.
path = wxString::FromUTF8( aDelta.new_file.path
116 ? aDelta.new_file.path
117 : aDelta.old_file.path );
119 if( aDelta.status == GIT_DELTA_RENAMED || aDelta.status == GIT_DELTA_COPIED )
120 entry.
oldPath = wxString::FromUTF8( aDelta.old_file.path );
122 result.push_back( std::move( entry ) );