You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Need to ensure the HEAD does not move, this is essentially a BugCheck
21
+
varexpectedSha=repo.Head.Tip.Sha;
22
+
varexpectedBranchName=repo.Head.CanonicalName;
23
+
24
+
try
20
25
{
21
-
// Need to ensure the HEAD does not move, this is essentially a BugCheck
22
-
varexpectedSha=repo.Head.Tip.Sha;
23
-
varexpectedBranchName=repo.Head.CanonicalName;
26
+
varremote=EnsureOnlyOneRemoteIsDefined(log,repo);
27
+
28
+
AddMissingRefSpecs(log,repo,remote);
24
29
25
-
try
30
+
//If noFetch is enabled, then GitVersion will assume that the git repository is normalized before execution, so that fetching from remotes is not required.
31
+
if(noFetch)
26
32
{
27
-
varremote=EnsureOnlyOneRemoteIsDefined(log,repo);
33
+
log.Info("Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories");
//If noFetch is enabled, then GitVersion will assume that the git repository is normalized before execution, so that fetching from remotes is not required.
32
-
if(noFetch)
33
-
{
34
-
log.Info("Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories");
log.Info($"Head has moved from '{expectedBranchName} | {expectedSha}' => '{newExpectedBranchName} | {newExpectedSha}', allowed since this is a dynamic repository");
51
52
52
-
log.Info($"Head has moved from '{expectedBranchName} | {expectedSha}' => '{newExpectedBranchName} | {newExpectedSha}', allowed since this is a dynamic repository");
53
+
expectedSha=newExpectedSha;
54
+
}
53
55
54
-
expectedSha=newExpectedSha;
55
-
}
56
+
varheadSha=repo.Refs.Head.TargetIdentifier;
56
57
57
-
varheadSha=repo.Refs.Head.TargetIdentifier;
58
+
if(!repo.Info.IsHeadDetached)
59
+
{
60
+
log.Info($"HEAD points at branch '{headSha}'.");
61
+
return;
62
+
}
58
63
59
-
if(!repo.Info.IsHeadDetached)
60
-
{
61
-
log.Info($"HEAD points at branch '{headSha}'.");
62
-
return;
63
-
}
64
+
log.Info($"HEAD is detached and points at commit '{headSha}'.");
// Whoa, HEAD has moved, it shouldn't have. We need to blow up because there is a bug in normalisation
127
-
thrownewBugException($@"GitVersion has a bug, your HEAD has moved after repo normalisation.
125
+
// Whoa, HEAD has moved, it shouldn't have. We need to blow up because there is a bug in normalisation
126
+
thrownewBugException($@"GitVersion has a bug, your HEAD has moved after repo normalisation.
128
127
129
128
To disable this error set an environmental variable called IGNORE_NORMALISATION_GIT_HEAD_MOVE to 1
130
129
131
130
Please run `git {CreateGitLogArgs(100)}` and submit it along with your build log (with personal info removed) in a new issue at https://github.com/GitTools/GitVersion");
0 commit comments