@@ -49,28 +49,36 @@ public void InitializeRepository(NPath expectedRepositoryPath = null)
49
49
{
50
50
Guard . NotNull ( this , FileSystem , nameof ( FileSystem ) ) ;
51
51
52
+ Logger . Trace ( "InitializeRepository expectedRepositoryPath:{0}" , expectedRepositoryPath ) ;
53
+
52
54
if ( RepositoryPath == null )
53
55
{
54
56
Guard . NotNull ( this , UnityProjectPath , nameof ( UnityProjectPath ) ) ;
55
57
58
+ Logger . Trace ( "RepositoryPath is null" ) ;
59
+
56
60
if ( expectedRepositoryPath == null )
57
61
expectedRepositoryPath = UnityProjectPath ;
58
62
59
63
if ( ! expectedRepositoryPath . DirectoryExists ( ".git" ) )
60
64
{
65
+ Logger . Trace ( ".git folder exists" ) ;
66
+
61
67
var reporoot = UnityProjectPath . RecursiveParents . FirstOrDefault ( d => d . DirectoryExists ( ".git" ) ) ;
62
68
if ( reporoot != null )
63
69
expectedRepositoryPath = reporoot ;
64
70
}
65
71
}
66
72
else
67
73
{
74
+ Logger . Trace ( "Set to RepositoryPath" ) ;
68
75
expectedRepositoryPath = RepositoryPath ;
69
76
}
70
77
71
78
FileSystem . SetCurrentDirectory ( expectedRepositoryPath ) ;
72
79
if ( expectedRepositoryPath . DirectoryExists ( ".git" ) )
73
80
{
81
+ Logger . Trace ( "Determined expectedRepositoryPath:{0}" , expectedRepositoryPath ) ;
74
82
RepositoryPath = expectedRepositoryPath ;
75
83
Repository = new Repository ( RepositoryPath . FileName , RepositoryPath ) ;
76
84
}
@@ -194,5 +202,6 @@ public static bool OnMac
194
202
set { onMac = value ; }
195
203
}
196
204
public string ExecutableExtension { get { return IsWindows ? ".exe" : null ; } }
205
+ protected static ILogging Logger { get ; } = Logging . GetLogger < DefaultEnvironment > ( ) ;
197
206
}
198
207
}
0 commit comments