worktree: avoid resolving HEAD unnecessarily
commited197a6ab983783550bd0b0c71cb97d734f4cfaa
authorEric Sunshine <sunshine@sunshineco.com>
Fri, 17 Jul 2015 23:00:15 +0000 (17 19:00 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Jul 2015 18:29:52 +0000 (20 11:29 -0700)
tree2c3b007274e0b02f4f95c56e8cff02247f9e5bd7
parent7f44e3d1de08bf99c8dbd69d6437b712df369692
worktree: avoid resolving HEAD unnecessarily

Now that git-worktree sets HEAD explicitly to its final value via either
git-symbolic-ref or git-update-ref, rather than relying upon
git-checkout to do so, the "hack" for pacifying is_git_directory() with
a temporary HEAD, though still necessary, can be simplified.

Since the real HEAD is now populated with its proper final value, the
value of the temporary HEAD truly no longer matters, and any value which
looks like an object ID is good enough to satisfy is_git_directory().
Therefore, just set the temporary HEAD to a literal value rather than
going through the effort of resolving the current branch's HEAD.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c