Skip to content

It looks like the branch being examined is a detached Head #1314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
benfoster opened this issue Oct 21, 2017 · 5 comments
Closed

It looks like the branch being examined is a detached Head #1314

benfoster opened this issue Oct 21, 2017 · 5 comments
Labels

Comments

@benfoster
Copy link

Hey guys,

Trying to get https://github.com/benfoster/Flo building on Travis and push packages to Nuget when tagged. Unfortunately I'm getting the following error:

WARN [10/21/17 17:08:07:38] An error occurred:
It looks like the branch being examined is a detached Head pointing to commit '90769ab'. Without a proper branch name GitVersion cannot determine the build version.

Any ideas?

@asbjornu
Copy link
Member

asbjornu commented Oct 25, 2017

Here's the source of the message:

void EnsureHeadIsNotDetached(GitVersionContext context)
{
if (!context.CurrentBranch.IsDetachedHead())
{
return;
}
var message = string.Format(
"It looks like the branch being examined is a detached Head pointing to commit '{0}'. " +
"Without a proper branch name GitVersion cannot determine the build version.",
context.CurrentCommit.Id.ToString(7));
throw new WarningException(message);
}

And here's the IsDetachedHead extension method:

public static bool IsDetachedHead(this Branch branch)
{
return branch.CanonicalName.Equals("(no branch)", StringComparison.OrdinalIgnoreCase);
}

So, for some reason, the checked out branch has a canonical name of (no branch). Ideas why that might be?

@gep13
Copy link
Member

gep13 commented Oct 25, 2017

var message = string.Format(
"It looks like the branch being examined is a detached Head pointing to commit '{0}'. " +
"Without a proper branch name GitVersion cannot determine the build version.",
context.CurrentCommit.Id.ToString(7));
throw new WarningException(message);

@gep13
Copy link
Member

gep13 commented Oct 25, 2017

@asbjornu just used that link that I sent you to create the above 😄

@asbjornu
Copy link
Member

@gep13: Aha, I need to both link to the blob as well as have from and to line numbers. Thanks!

@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 29, 2019
@stale stale bot closed this as completed Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants