Merge branches 'lt/refs' and 'lt/ref2' into next

* lt/refs:
  fsck-objects: adjust to resolve_ref() clean-up.
  gitignore: git-pack-refs is a generated file.

* lt/ref2:
  gitignore: git-show-ref is a generated file.
This commit is contained in:
Junio C Hamano
2006-09-18 01:08:22 -07:00
2 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View File

@@ -74,6 +74,7 @@ git-name-rev
git-mv
git-pack-redundant
git-pack-objects
git-pack-refs
git-parse-remote
git-patch-id
git-peek-remote
@@ -105,6 +106,7 @@ git-shortlog
git-show
git-show-branch
git-show-index
git-show-ref
git-ssh-fetch
git-ssh-pull
git-ssh-push

View File

@@ -458,15 +458,13 @@ static void fsck_object_dir(const char *path)
static int fsck_head_link(void)
{
unsigned char sha1[20];
const char *git_HEAD = xstrdup(git_path("HEAD"));
const char *git_refs_heads_master = resolve_ref(git_HEAD, sha1, 1);
int pfxlen = strlen(git_HEAD) - 4; /* strip .../.git/ part */
const char *head_points_at = resolve_ref("HEAD", sha1, 1);
if (!git_refs_heads_master)
if (!head_points_at)
return error("HEAD is not a symbolic ref");
if (strncmp(git_refs_heads_master + pfxlen, "refs/heads/", 11))
if (strncmp(head_points_at, "refs/heads/", 11))
return error("HEAD points to something strange (%s)",
git_refs_heads_master + pfxlen);
head_points_at);
if (is_null_sha1(sha1))
return error("HEAD: not a valid git pointer");
return 0;