From 988d229bbf40e417203662f229b72d87db4af5ce Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Tue, 21 Jan 2025 16:17:51 -0800 Subject: [PATCH] Clean up unused var Turns out we didn't need that one --- common/git/kicad_git_common.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/common/git/kicad_git_common.cpp b/common/git/kicad_git_common.cpp index 47d1fe2913..6d3b2e5736 100644 --- a/common/git/kicad_git_common.cpp +++ b/common/git/kicad_git_common.cpp @@ -465,7 +465,6 @@ void KIGIT_COMMON::updatePublicKeys() wxTextFile configFile( sshConfig.GetFullPath() ); configFile.Open(); - wxString lastIdentityFile; bool match = false; for( wxString line = configFile.GetFirstLine(); !configFile.Eof(); line = configFile.GetNextLine() ) @@ -473,10 +472,7 @@ void KIGIT_COMMON::updatePublicKeys() line.Trim( false ).Trim( true ); if( line.StartsWith( "Host " ) ) - { - lastIdentityFile.Clear(); match = false; - } // The difference here is that we are matching either "Hostname" or "Host" to get the // match. This is because in the absence of a "Hostname" line, the "Host" line is used @@ -486,15 +482,14 @@ void KIGIT_COMMON::updatePublicKeys() if( match && line.StartsWith( "IdentityFile" ) ) { wxString keyPath = line.AfterFirst( ' ' ).Trim( false ).Trim( true ); + // Expand ~ to home directory if present if( keyPath.StartsWith( "~" ) ) keyPath.Replace( "~", wxGetHomeDir(), false ); // Add the public key to the beginning of the list if( wxFileName::FileExists( keyPath ) ) - { SetSSHKey( keyPath ); - } } }