Open Meorge opened 2 months ago
Hi,
I think, the problem is unrelated to Fork. It just happened that the repository got corrupted. I don't know how Time Machine works internally, but may be it made a snapshot in some intermediate repository state (when gc
was running, for example).
error: refs/heads/main: invalid reflog entry 976361a9018a860de264cf827d753b8e541c4abf error: refs/heads/main: invalid reflog entry 976361a9018a860de264cf827d753b8e541c4abf error: refs/remotes/origin/main: invalid reflog entry 976361a9018a860de264cf827d753b8e541c4abf error: refs/remotes/origin/main: invalid reflog entry 976361a9018a860de264cf827d753b8e541c4abf
Make a backup of the repo and try to remove those reflog files: .git/logs/refs/heads/main
and .git/logs/refs/remotes/origin/main
Or even remove whole .git/logs/
directory
Thanks for the quick response! Unfortunately, I tried both of those, and it appears the issue is persisting. I was able to pull the most recent version of the repository from GitHub, though, so it's not a huge issue. š
As I said before, I don't think that Fork was to blame for the corruption - looks more likely to me that it had to do with Time Machine, as well. I just thought that Fork's behavior displaying the corrupted repository (empty commit view with a bunch of numbers in the detail panel) was confusing, and it might be good to have it display something else instead, perhaps detecting when the repository is corrupted and telling the user so?
The reason I marked this as [bug?] and not just [bug] is that it's dealing with a corrupted repository, so I'm not sure how much Fork should be expected to handle that kind of situation š Tools for recognizing (and especially repairing) corrupted repos would be awesome, but also perhaps out of scope
Today I restored a Time Machine backup on my computer, and after doing so went to check on one of my repositories. I found I was unable to view the list of commits, and the "detail" panel was full of numbers:
When I tried to fetch changes, I got this:
Running
git fsck
on the repository, I can see there are a bunch of issues with it:I've gone through and checked older copies of the repository via Time Machine, and as far as I can tell, the corruption appeared to have happened during one of the Time Machine backups (i.e., Fork did not corrupt the repository, to my understanding). Between that and cloning a new copy from GitHub, it looks like everything is ultimately okay, but it could be nice to have a more usable message for situations like this.
I'm holding onto the corrupted copy of the repository for now, so if there's any more information you'd like me to gather on it, I can do so.