From df70ce72b47e4aafbcc869cdcd3e4ba55dc47f22 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 8 Feb 2025 16:34:08 -0500 Subject: [PATCH] Git: do not try to get branch info if there isn't a repo --- kicad/project_tree_pane.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index 9504c6a7b4..77fa022163 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -639,9 +639,13 @@ void PROJECT_TREE_PANE::ReCreateTreePrj() if( ADVANCED_CFG::GetCfg().m_EnableGit ) { m_TreeProject->SetGitRepo( get_git_repository_for_file( fn.GetPath().c_str() ) ); - m_TreeProject->GitCommon()->SetUsername( Prj().GetLocalSettings().m_GitRepoUsername ); - m_TreeProject->GitCommon()->SetSSHKey( Prj().GetLocalSettings().m_GitSSHKey ); - m_TreeProject->GitCommon()->UpdateCurrentBranchInfo(); + + if( m_TreeProject->GetGitRepo() ) + { + m_TreeProject->GitCommon()->SetUsername( Prj().GetLocalSettings().m_GitRepoUsername ); + m_TreeProject->GitCommon()->SetSSHKey( Prj().GetLocalSettings().m_GitSSHKey ); + m_TreeProject->GitCommon()->UpdateCurrentBranchInfo(); + } } // We may have opened a legacy project, in which case GetProjectFileName will return the