7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 19:59:18 +00:00

KIGIT: fix crash when the repo has no remote set

This commit is contained in:
Tomasz Wlostowski 2025-03-25 16:06:33 +01:00
parent 69f758dbcd
commit 1638322649

View File

@ -371,11 +371,15 @@ std::pair<std::set<wxString>,std::set<wxString>> KIGIT_COMMON::GetDifferentFiles
}
KIGIT::GitReferencePtr remoteHeadPtr( remote_head );
const git_oid* head_oid = git_reference_target( head );
const git_oid* remote_oid = git_reference_target( remote_head );
modified_files.first = get_modified_files( head_oid, remote_oid );
modified_files.second = get_modified_files( remote_oid, head_oid );
if( remote_head != nullptr && head != nullptr )
{
const git_oid* head_oid = git_reference_target( head );
const git_oid* remote_oid = git_reference_target( remote_head );
modified_files.first = get_modified_files( head_oid, remote_oid );
modified_files.second = get_modified_files( remote_oid, head_oid );
}
return modified_files;
}