Re: [PATCH v2 08/23] checkout: fix bug with --to and relative HEAD

2015-07-05 Thread Eric Sunshine
On Fri, Jul 3, 2015 at 10:45 PM, Duy Nguyen pclo...@gmail.com wrote: On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine sunsh...@sunshineco.com wrote: Given git checkout --to path HEAD~1, the new worktree's HEAD should begin life at the current branch's HEAD~1, however, it actually ends up at

Re: [PATCH v2 08/23] checkout: fix bug with --to and relative HEAD

2015-07-03 Thread Duy Nguyen
On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine sunsh...@sunshineco.com wrote: Given git checkout --to path HEAD~1, the new worktree's HEAD should begin life at the current branch's HEAD~1, however, it actually ends up at HEAD~2. The happens because: 1. git-checkout resolves HEAD~1 2.

[PATCH v2 08/23] checkout: fix bug with --to and relative HEAD

2015-07-03 Thread Eric Sunshine
Given git checkout --to path HEAD~1, the new worktree's HEAD should begin life at the current branch's HEAD~1, however, it actually ends up at HEAD~2. The happens because: 1. git-checkout resolves HEAD~1 2. to satisfy is_git_directory, prepare_linked_worktree() creates a HEAD in