driusan / dgit

A Pure Go Git Implementation
MIT License
112 stars 10 forks source link

Could not find origin/master #252

Closed henesy closed 5 years ago

henesy commented 5 years ago

I'm not sure if this is a real issue or not, but I had a repository somehow end up in a state where it could not find origin/master on git pull.

I can push just fine, and other repositories pull fine, but one I was working in now does not pull.

This might just be something dumb I did and don't remember.

Log: http://okturing.com/src/6786/body

driusan commented 5 years ago

That definitely looks like a bug in dgit to me, I don't see anything wrong with that config file.

henesy commented 5 years ago

Want a tgz of the repository?

driusan commented 5 years ago

If it's easy to put somewhere. I spent a couple minutes trying to reproduce by deleting things from the .git directory after doing a clone but only managed to break things in different ways.

henesy commented 5 years ago

http://postnix.pw/sports.tgz

I couldn't say exactly what I did to produce this state, I apologize.

I'm pretty sure in the case of this repository it was made from git init and I added the remote/origin later. I'm not sure what commands I ran at the time, but I probably went off dgit output.

driusan commented 5 years ago

There's no file ".git/refs/remotes/origin/master" in the tarball,so neither dgit nor git can push it. I think #253 should prevent it from happening in the future. To fix your local copy, you should be able to just copy .git/refs/heads/master onto .git/refs/remotes/origin/master

henesy commented 5 years ago

Ahhhhhh that makes sense many thanks as always :)

I’ll test my repo soon

henesy commented 5 years ago

I can confirm my repo works with quick fix!

I didn't realize this was a thing, thank you :)

driusan commented 5 years ago

it was supposed to be created when you did the first git push (or when you do a git clone/fetch), but there was a bug with where dgit push didn't create it since you created the repo with git init

henesy commented 5 years ago

That makes sense ya