@@ -49,28 +49,36 @@ public void InitializeRepository(NPath expectedRepositoryPath = null)
4949 {
5050 Guard . NotNull ( this , FileSystem , nameof ( FileSystem ) ) ;
5151
52+ Logger . Trace ( "InitializeRepository expectedRepositoryPath:{0}" , expectedRepositoryPath ) ;
53+
5254 if ( RepositoryPath == null )
5355 {
5456 Guard . NotNull ( this , UnityProjectPath , nameof ( UnityProjectPath ) ) ;
5557
58+ Logger . Trace ( "RepositoryPath is null" ) ;
59+
5660 if ( expectedRepositoryPath == null )
5761 expectedRepositoryPath = UnityProjectPath ;
5862
5963 if ( ! expectedRepositoryPath . DirectoryExists ( ".git" ) )
6064 {
65+ Logger . Trace ( ".git folder exists" ) ;
66+
6167 var reporoot = UnityProjectPath . RecursiveParents . FirstOrDefault ( d => d . DirectoryExists ( ".git" ) ) ;
6268 if ( reporoot != null )
6369 expectedRepositoryPath = reporoot ;
6470 }
6571 }
6672 else
6773 {
74+ Logger . Trace ( "Set to RepositoryPath" ) ;
6875 expectedRepositoryPath = RepositoryPath ;
6976 }
7077
7178 FileSystem . SetCurrentDirectory ( expectedRepositoryPath ) ;
7279 if ( expectedRepositoryPath . DirectoryExists ( ".git" ) )
7380 {
81+ Logger . Trace ( "Determined expectedRepositoryPath:{0}" , expectedRepositoryPath ) ;
7482 RepositoryPath = expectedRepositoryPath ;
7583 Repository = new Repository ( RepositoryPath . FileName , RepositoryPath ) ;
7684 }
@@ -194,5 +202,6 @@ public static bool OnMac
194202 set { onMac = value ; }
195203 }
196204 public string ExecutableExtension { get { return IsWindows ? ".exe" : null ; } }
205+ protected static ILogging Logger { get ; } = Logging . GetLogger < DefaultEnvironment > ( ) ;
197206 }
198207}
0 commit comments