Skip to content
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

Error: no reference found for shorthand 'origin/HEAD' #202

Closed
BerkeleyTrue opened this issue May 12, 2022 · 9 comments · Fixed by #215
Closed

Error: no reference found for shorthand 'origin/HEAD' #202

BerkeleyTrue opened this issue May 12, 2022 · 9 comments · Fixed by #215

Comments

@BerkeleyTrue
Copy link

After updating to 4.0 recently I started experiencing this issue.

Error: no reference found for shorthand 'origin/HEAD'; class=Reference (4); code=NotFound (-3)

image

Downgrading back to 3.0 doesn't show the same issue
image

I saw there was a PR for a similar issue that was merged in quite some time ago. Did that not make it into the new release?

@nickgerace
Copy link
Owner

Ah yes, I thought it had been fixed with #192 or another issue that I am not recalling at the moment. Thanks for filing the issue; I'll look into it.

Would you mind running with RUST_LOG=debug RUST_BACKTRACE=1 gfold? Please feel free to redact any sensitive information, though I doubt that'll be the case.

@BerkeleyTrue
Copy link
Author

BerkeleyTrue commented May 16, 2022

@AckslD
Copy link
Contributor

AckslD commented May 23, 2022

I'm also still seeing this issue when the remote is something else then origin.

@nickgerace
Copy link
Owner

nickgerace commented May 23, 2022

Thank you @BerkeleyTrue and @AckslD. I'll try to catch this bug by adjusting the integration test payload and see what I can do.

@AckslD
Copy link
Contributor

AckslD commented Nov 9, 2022

@nickgerace I made an attempt to add a failing test reproducing this in #210. My rust skills are not very high but I hope it can help to find the underlying issue :)

nickgerace pushed a commit that referenced this issue Dec 19, 2022
@nickgerace
Copy link
Owner

nickgerace commented Dec 19, 2022

Merged #210 and going to look further. CI needs to catch this as well if it does not.

@nickgerace
Copy link
Owner

nickgerace commented Dec 20, 2022

Thank to @AckslD's PR, I think I figured it out.

The app tries to determine if a repository (with its current checked out branch) is in the "unpushed" state by checking if the local branch has a corresponding remote. If it does, then we check if the commits match. If it doesn't then we assume that the state is "unpushed". The problem here was in the latter check. During that check, we try to resolve the reference with a given short name, but we would fail if we could not. Well, if a remote branch doesn't exist with that short name (e.g. origin/HEAD), then we will always fail, which is undesired behavior. I believe #215 should solve the issue.

EDIT: if #215 did not solve the problem, I'll re-open this issue.

@AckslD
Copy link
Contributor

AckslD commented Jan 4, 2023

Thanks @nickgerace, things seem to indeed work now for me :)

@nickgerace
Copy link
Owner

Glad to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants