author | Jeff King <peff@peff.net> | |
Thu, 29 Jan 2009 08:30:16 +0000 (03:30 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 29 Jan 2009 09:00:43 +0000 (01:00 -0800) | ||
commit | b229d18a809c169314b7f0d048dc5a7632e8f916 | |
tree | 2d7131d7cf68a4e014e88ecb2134f5b3184aa286 | tree | snapshot |
parent | b296e8fce6de6a40a41b5168dfbe735d11255256 | commit | diff |
validate_headref: tighten ref-matching to just branches
When we are trying to determine whether a directory contains
a git repository, one of the tests we do is to check whether
HEAD is either a symlink or a symref into the "refs/"
hierarchy, or a detached HEAD.
We can tighten this a little more, though: a non-detached
HEAD should always point to a branch (since checking out
anything else should result in detachment), so it is safe to
check for "refs/heads/".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When we are trying to determine whether a directory contains
a git repository, one of the tests we do is to check whether
HEAD is either a symlink or a symref into the "refs/"
hierarchy, or a detached HEAD.
We can tighten this a little more, though: a non-detached
HEAD should always point to a branch (since checking out
anything else should result in detachment), so it is safe to
check for "refs/heads/".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
path.c | diff | blob | history |