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 wrote: > On Sat, Jul 4, 2015 at 7:17 AM, Eric Sunshine wrote: >> Given "git checkout --to 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.

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 wrote: > Given "git checkout --to 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_

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

2015-07-03 Thread Eric Sunshine
Given "git checkout --to 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 the