Skip to content

Commit df30364

Browse files
committed
fix qodana issues
1 parent f1babbb commit df30364

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

qodana.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
44
#-------------------------------------------------------------------------------#
55
version: "1.0"
6-
#Specify IDE code to run analysis without container (Applied in CI/CD pipeline)
7-
ide: QDNET
86
#Specify inspection profile for code analysis
97
profile:
108
name: qodana.starter

src/GitVersion.App.Tests/HelpWriterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void AllArgsAreInHelp()
4646
{ nameof(Arguments.NoCache), "/nocache" },
4747
{ nameof(Arguments.NoFetch), "/nofetch" },
4848
{ nameof(Arguments.NoNormalize), "/nonormalize" },
49-
{ nameof(Arguments.AllowShallow), "/allowshallow" },
49+
{ nameof(Arguments.AllowShallow), "/allowshallow" }
5050
};
5151
var helpText = string.Empty;
5252

@@ -55,7 +55,7 @@ public void AllArgsAreInHelp()
5555
var ignored = new[]
5656
{
5757
nameof(Arguments.Authentication),
58-
nameof(Arguments.UpdateAssemblyInfoFileName),
58+
nameof(Arguments.UpdateAssemblyInfoFileName)
5959
};
6060
typeof(Arguments).GetFields()
6161
.Select(p => p.Name)

src/GitVersion.App/Arguments.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public GitVersionOptions ToOptions()
7979
NoFetch = NoFetch,
8080
NoCache = NoCache,
8181
NoNormalize = NoNormalize,
82-
AllowShallow = AllowShallow,
82+
AllowShallow = AllowShallow
8383
},
8484

8585
WixInfo =

src/GitVersion.Core/Core/GitPreparer.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,16 +188,14 @@ private void NormalizeGitDirectory(bool noFetch, string? currentBranchName, bool
188188
EnsureHeadIsAttachedToBranch(currentBranchName, authentication);
189189
EnsureRepositoryHeadDuringNormalisation(nameof(EnsureHeadIsAttachedToBranch), expectedSha);
190190

191-
if (this.repository.IsShallow)
191+
if (!this.repository.IsShallow) return;
192+
if (this.options.Value.Settings.AllowShallow)
192193
{
193-
if (this.options.Value.Settings.AllowShallow)
194-
{
195-
this.log.Info("Repository is a shallow clone. GitVersion will continue, but it is recommended to use a full clone for accurate versioning.");
196-
}
197-
else
198-
{
199-
throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info.");
200-
}
194+
this.log.Info("Repository is a shallow clone. GitVersion will continue, but it is recommended to use a full clone for accurate versioning.");
195+
}
196+
else
197+
{
198+
throw new WarningException("Repository is a shallow clone. Git repositories must contain the full history. See https://gitversion.net/docs/reference/requirements#unshallow for more info.");
201199
}
202200
}
203201

0 commit comments

Comments
 (0)