Current behavior 😯
Running repo.rev_parse_single("@{-1}") in a repo where the last checked out branch has been deleted returns the object id of the commit (tip of branch before deletion)
Expected behavior 🤔
It should return an error
Git behavior
In this case, git rev-parse --verify @{-1} returns an errors: "fatal: Needed a single revision" and exit code 128.
Steps to reproduce 🕹
Prepare a test repo (with a branch that was previously checked out but is now deleted):
git init
git commit --allow-empty -m c1
git checkout -b prev-target
git checkout -
git branch -d prev-target
And in this repo, run repo.rev_parse_single("@{-1}") or git rev-parse --verify @{-1} previously mentioned to observe the mismatch between gix and git
Current behavior 😯
Running
repo.rev_parse_single("@{-1}")in a repo where the last checked out branch has been deleted returns the object id of the commit (tip of branch before deletion)Expected behavior 🤔
It should return an error
Git behavior
In this case,
git rev-parse --verify @{-1}returns an errors: "fatal: Needed a single revision" and exit code 128.Steps to reproduce 🕹
Prepare a test repo (with a branch that was previously checked out but is now deleted):
And in this repo, run
repo.rev_parse_single("@{-1}")orgit rev-parse --verify @{-1}previously mentioned to observe the mismatch between gix and git