This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
src/UnityExtension/Assets/Editor/GitHub.Unity/UI Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -688,20 +688,29 @@ private void OnGitLfsLocksGUI()
688688 private void OnInstallPathGUI ( )
689689 {
690690 string gitExecPath = null ;
691+ string gitExecParentPath = null ;
692+
691693 string extension = null ;
692- string gitInstallPath = null ;
694+
693695 if ( Environment != null )
694696 {
695697 extension = Environment . ExecutableExtension ;
698+
696699 if ( Environment . IsWindows )
697700 {
698701 extension = extension . TrimStart ( '.' ) ;
699702 }
700703
701- gitInstallPath = Environment . GitInstallPath ;
702-
703704 if ( Environment . GitExecutablePath != null )
705+ {
704706 gitExecPath = Environment . GitExecutablePath . ToString ( ) ;
707+ gitExecParentPath = Environment . GitExecutablePath . Parent . ToString ( ) ;
708+ }
709+
710+ if ( gitExecParentPath == null )
711+ {
712+ gitExecParentPath = Environment . GitInstallPath ;
713+ }
705714 }
706715
707716 // Install path
@@ -715,7 +724,7 @@ private void OnInstallPathGUI()
715724 //TODO: Verify necessary value for a non Windows OS
716725 Styles . PathField ( ref gitExecPath ,
717726 ( ) => EditorUtility . OpenFilePanel ( GitInstallBrowseTitle ,
718- gitInstallPath ,
727+ gitExecParentPath ,
719728 extension ) , ValidateGitInstall ) ;
720729 }
721730 if ( EditorGUI . EndChangeCheck ( ) )
You can’t perform that action at this time.
0 commit comments