chiark / gitweb /
Use "git-rev-parse" to get the HEAD commit
authorChuck Lever <cel@netapp.com>
Mon, 3 Oct 2005 17:03:31 +0000 (13:03 -0400)
committerCatalin Marinas <catalin.marinas@gmail.com>
Tue, 4 Oct 2005 19:56:17 +0000 (20:56 +0100)
commit3097799dcde97cc3e1e3d6c87138f300df0ec2b6
tree5629dfb8d07d80630bb31ae5b9afbff7af9606be
parentbca12bd1634520a9d1b81daa6a48e0b09a0df879
Use "git-rev-parse" to get the HEAD commit

Traditionally, HEAD was just a link to a refs file.  Recently, however,
support for HEADs of the form "ref: " was added to git.  In addition,
it's safer to verify the HEAD commit id before using it.

Change git.py to use "git-rev-parse" to derive the HEAD commit instead of
reading the HEAD link directly.  If there are any problems with the HEAD
commit id, git.get_head() now raises an exception.

And, use "git-update-ref" to update the HEAD for similar reasons.

Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/git.py