-
-
Notifications
You must be signed in to change notification settings - Fork 44
Trying to fix a non-existent HEAD #87
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -755,7 +755,16 @@ defmodule GitRekt.GitAgent do | |
| {:ok, name, shorthand, oid} -> | ||
| {:ok, resolve_reference({name, shorthand, :oid, oid})} | ||
| {:error, reason} -> | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What kind of error are you getting here? And how doe it happen?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Refer to the third paragraph of this comment: #87 (comment) Reproduction steps:
|
||
| {:error, reason} | ||
| case Git.reference_stream(handle, "refs/heads/*") do | ||
| {:ok, stream} -> | ||
| with %GitRef{name: name} = | ||
| ref <- Enum.at(Stream.map(stream, &resolve_reference_peel!(&1, :undefined, handle)), 0), | ||
| :ok <- Git.repository_set_head(handle, "refs/heads/#{name}") do | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure this is a good idea I'd prefer to fix the issue upfront over implicitly updating the HEAD here. |
||
| {:ok, ref} | ||
| end || {:error, reason} | ||
| {:error, reason} -> | ||
| {:error, reason} | ||
| end | ||
| end | ||
| end | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
We could use that for letting the repository owner/admin change the default branch in the repository settings.