Description
I got the following error on "gl status" after I reset the head to the branch to a previous commit using "gl branch --set-head":
`On branch tmp, repo-directory //
✘ Some internal error occurred
➜ If you want to help, see http://gitless.com for info on how to report bugs and include the following information:
0.8.6
Traceback (most recent call last):
File "gitless/cli/gl.py", line 99, in main
File "gitless/cli/gl_status.py", line 45, in main
File "gitless/core.py", line 765, in status
KeyError: 513
`
Steps to reproduce:
- Create a new file (lets call it f.txt) in the branch and commit
- reset the head of the branch to a commit prior to this commit using "gl branch -sh"
- Contrary to my expectations, f.txt is still there and gl status shows it as tracked and "new file"
- Remove f.txt using the OS: "rm f.txt"
- "gl status" crashes
Other gl commands fail too from this point on. The only way to resolve this situation that I could find is to manually recreate the deleted file (touch f.txt).
I think there are really two issues here: the obvious that lets "gl status" crash and the "strange" behaviour of gl branch -sh. My expectation would be that resetting the head of a branch brings my workspace to a state that reflects this new head (possibly creating missing or removing non-existant files). This behaviour would be consistent to what "gl switch" does between branches.