Skip to content

Commit acd21a9

Browse files
committed
cleanup for GitPreparer
1 parent b7d207f commit acd21a9

File tree

8 files changed

+121
-115
lines changed

8 files changed

+121
-115
lines changed

src/GitVersion.App.Tests/ArgumentParserTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ public void EnsureAssemblyInfoFalse()
631631
public void DynamicRepoLocation()
632632
{
633633
var arguments = this.argumentParser.ParseArguments("-dynamicRepoLocation c:\\foo\\");
634-
arguments.DynamicRepositoryClonePath.ShouldBe("c:\\foo\\");
634+
arguments.ClonePath.ShouldBe("c:\\foo\\");
635635
}
636636

637637
[Test]

src/GitVersion.App.Tests/HelpWriterTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void AllArgsAreInHelp()
2626
{ nameof(Arguments.TargetBranch), "/b" },
2727
{ nameof(Arguments.LogFilePath) , "/l" },
2828
{ nameof(Arguments.OutputFile) , "/outputfile" },
29-
{ nameof(Arguments.DynamicRepositoryClonePath), "/dynamicRepoLocation" },
29+
{ nameof(Arguments.ClonePath), "/dynamicRepoLocation" },
3030
{ nameof(Arguments.IsHelp), "/?" },
3131
{ nameof(Arguments.IsVersion), "/version" },
3232
{ nameof(Arguments.UpdateWixVersionFile), "/updatewixversionfile" },

src/GitVersion.App/ArgumentParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private static bool ParseRemoteArguments(Arguments arguments, string? name, IRea
311311
if (name.IsSwitch("dynamicRepoLocation"))
312312
{
313313
EnsureArgumentValueCount(values);
314-
arguments.DynamicRepositoryClonePath = value;
314+
arguments.ClonePath = value;
315315
return true;
316316
}
317317

src/GitVersion.App/Arguments.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class Arguments
1919
public string? TargetUrl;
2020
public string? TargetBranch;
2121
public string? CommitId;
22-
public string? DynamicRepositoryClonePath;
22+
public string? ClonePath;
2323

2424
public bool Init;
2525
public bool Diag;
@@ -72,7 +72,7 @@ public GitVersionOptions ToOptions()
7272
TargetUrl = TargetUrl,
7373
TargetBranch = TargetBranch,
7474
CommitId = CommitId,
75-
DynamicRepositoryClonePath = DynamicRepositoryClonePath
75+
ClonePath = ClonePath
7676
},
7777

7878
Settings =

src/GitVersion.Core.Tests/Core/DynamicRepositoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void FindsVersionInDynamicRepo(string name, string url, string targetBran
6161
RepositoryInfo =
6262
{
6363
TargetUrl = url,
64-
DynamicRepositoryClonePath = dynamicDirectory,
64+
ClonePath = dynamicDirectory,
6565
TargetBranch = targetBranch,
6666
CommitId = commitId
6767
},

src/GitVersion.Core/Core/GitPreparer.cs

Lines changed: 112 additions & 106 deletions
Large diffs are not rendered by default.

src/GitVersion.Core/Model/RepositoryInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ public class RepositoryInfo
55
public string? TargetUrl;
66
public string? TargetBranch;
77
public string? CommitId;
8-
public string? DynamicRepositoryClonePath;
8+
public string? ClonePath;
99
}

src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public GitRepositoryInfo(IOptions<GitVersionOptions> options)
3535
if (repositoryInfo.TargetUrl.IsNullOrWhiteSpace()) return null;
3636

3737
var targetUrl = repositoryInfo.TargetUrl;
38-
var dynamicRepositoryClonePath = repositoryInfo.DynamicRepositoryClonePath;
38+
var clonePath = repositoryInfo.ClonePath;
3939

40-
var userTemp = dynamicRepositoryClonePath ?? Path.GetTempPath();
40+
var userTemp = clonePath ?? Path.GetTempPath();
4141
var repositoryName = targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty);
4242
var possiblePath = PathHelper.Combine(userTemp, repositoryName);
4343

0 commit comments

Comments
 (0)