You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I want to use the method Reset or Checkout to switch to my history versions. It is expected that, if I give an invalid commit Hash, Reset or Checkout will abort and return a non-nil error.
In the following code, I give Reset an invalid plumbing Hash. However, unexpected things happened:
Although err != nil and there will be a panic, the worktree is switched to a bad state. Now when I send the command git log on shell, I get fatal: bad object HEAD.
That is, Reset or Checkout won't rollback when failed. The HEAD will be changed to a bad object.