@@ -1015,10 +1015,10 @@ public static void RemoveContextMenuRegistry(string contextRegRoot)
1015
1015
public static string ReadGitBranchInfo ( string projectPath )
1016
1016
{
1017
1017
string results = null ;
1018
- DirectoryInfo dirName = FindDir ( ".git" , projectPath ) ;
1019
- if ( dirName != null )
1018
+ string dirName = Path . Combine ( projectPath , ".git" ) ;
1019
+ if ( Directory . Exists ( dirName ) )
1020
1020
{
1021
- string branchFile = Path . Combine ( dirName . FullName , "HEAD" ) ;
1021
+ string branchFile = Path . Combine ( dirName , "HEAD" ) ;
1022
1022
if ( File . Exists ( branchFile ) )
1023
1023
{
1024
1024
// removes extra end of line
@@ -1034,10 +1034,10 @@ public static string ReadGitBranchInfo(string projectPath)
1034
1034
public static string ReadPlasticBranchInfo ( string projectPath )
1035
1035
{
1036
1036
string results = null ;
1037
- DirectoryInfo dirName = FindDir ( ".plastic" , projectPath ) ;
1038
- if ( dirName != null )
1037
+ string dirName = Path . Combine ( projectPath , ".plastic" ) ;
1038
+ if ( Directory . Exists ( dirName ) )
1039
1039
{
1040
- string branchFile = Path . Combine ( dirName . FullName , "plastic.selector" ) ;
1040
+ string branchFile = Path . Combine ( dirName , "plastic.selector" ) ;
1041
1041
if ( File . Exists ( branchFile ) )
1042
1042
{
1043
1043
// removes extra end of line
@@ -1107,29 +1107,6 @@ public static string GetTargetPlatform(string projectPath)
1107
1107
}
1108
1108
}
1109
1109
1110
- /// <summary>
1111
- /// Searches for a directory beginning with "startPath".
1112
- /// If the directory is not found, then parent folders are searched until
1113
- /// either it is found or the root folder has been reached.
1114
- /// Null is returned if the directory was not found.
1115
- /// </summary>
1116
- /// <param name="dirName"></param>
1117
- /// <param name="startPath"></param>
1118
- /// <returns></returns>
1119
- public static DirectoryInfo FindDir ( string dirName , string startPath )
1120
- {
1121
- DirectoryInfo dirInfo = new DirectoryInfo ( Path . Combine ( startPath , dirName ) ) ;
1122
- while ( ! dirInfo . Exists )
1123
- {
1124
- if ( dirInfo . Parent . Parent == null )
1125
- {
1126
- return null ;
1127
- }
1128
- dirInfo = new DirectoryInfo ( Path . Combine ( dirInfo . Parent . Parent . FullName , dirName ) ) ;
1129
- }
1130
- return dirInfo ;
1131
- }
1132
-
1133
1110
public static string ReadCustomProjectData ( string projectPath , string customFile )
1134
1111
{
1135
1112
string results = null ;
0 commit comments