Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 9d81fe1

Browse files
committed
Small cleanup
1 parent d7788d8 commit 9d81fe1

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/GitTools.Core/GitTools.Core.Shared/Git/DynamicRepositories.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static class DynamicRepositories
2121
/// <returns>The git repository.</returns>
2222
public static DynamicRepository CreateOrOpen(RepositoryInfo repositoryInfo, string dynamicRepsitoryPath, string targetBranch, string targetCommit)
2323
{
24-
if (!Directory.Exists(dynamicRepsitoryPath))
24+
if (string.IsNullOrWhiteSpace(dynamicRepsitoryPath) || !Directory.Exists(dynamicRepsitoryPath))
2525
throw new GitToolsException(string.Format("Dynamic repository path {0} does not exist, ensure it is created before trying to create dynamic repository.", dynamicRepsitoryPath));
2626
if (string.IsNullOrWhiteSpace(targetBranch))
2727
throw new GitToolsException("Dynamic Git repositories must have a target branch");
@@ -70,14 +70,8 @@ static string GetLockFile(string repoPath)
7070

7171
static string GetAndLockTemporaryRepositoryPath(string targetUrl, string dynamicRepositoryLocation)
7272
{
73-
var userTemp = dynamicRepositoryLocation;
74-
if (string.IsNullOrWhiteSpace(userTemp))
75-
{
76-
userTemp = Path.GetTempPath();
77-
}
78-
7973
var repositoryName = targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty);
80-
var possiblePath = Path.Combine(userTemp, repositoryName);
74+
var possiblePath = Path.Combine(dynamicRepositoryLocation, repositoryName);
8175

8276
var i = 1;
8377
var originalPath = possiblePath;

0 commit comments

Comments
 (0)