author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 5 Jul 2007 23:19:37 +0000 (19:19 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 9 Jul 2007 01:12:56 +0000 (21:12 -0400) | ||
commit | 311e02a4a5c7b82c996214f06d58e2b51b3ecc22 | |
tree | 6036fbe6fc3fe2a621ba7d7cf235ab6d987947f6 | tree | snapshot |
parent | ba1964be26b8b9e3441591257a2c87f5811d6b50 | commit | diff |
git-gui: Better handling of detached HEAD
If the current branch is not a symbolic-ref that points to a
name in the refs/heads/ namespace we now just assume that the
head is a detached head. In this case we return the special
branch name of HEAD rather than empty string, as HEAD is a
valid revision specification and the empty string is not.
I have also slightly improved the current-branch function by
using string functions to parse the symbolic-ref data. This
should be slightly faster than using a regsub. I think the
code is clearer too.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
If the current branch is not a symbolic-ref that points to a
name in the refs/heads/ namespace we now just assume that the
head is a detached head. In this case we return the special
branch name of HEAD rather than empty string, as HEAD is a
valid revision specification and the empty string is not.
I have also slightly improved the current-branch function by
using string functions to parse the symbolic-ref data. This
should be slightly faster than using a regsub. I think the
code is clearer too.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | diff | blob | history |