From b3dc864c6d5ffb96513328f976c076c3a90331b0 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 18 Sep 2006 00:34:38 -0700 Subject: [PATCH 1/3] gitignore: git-pack-refs is a generated file. Signed-off-by: Junio C Hamano --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a3d9c7a11d..1ff28c7c56 100644 --- a/.gitignore +++ b/.gitignore @@ -73,6 +73,7 @@ git-name-rev git-mv git-pack-redundant git-pack-objects +git-pack-refs git-parse-remote git-patch-id git-peek-remote From 582c5b09be6336e74a366ad900ca7ec3a5d1572d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Mon, 18 Sep 2006 00:35:07 -0700 Subject: [PATCH 2/3] gitignore: git-show-ref is a generated file. Signed-off-by: Junio C Hamano --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0d608fe12a..f53e0b247c 100644 --- a/.gitignore +++ b/.gitignore @@ -102,6 +102,7 @@ git-shortlog git-show git-show-branch git-show-index +git-show-ref git-ssh-fetch git-ssh-pull git-ssh-push From 5b10b091139ea5ef87376998c89f3a20dd7c7793 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 18 Sep 2006 01:08:00 -0700 Subject: [PATCH 3/3] fsck-objects: adjust to resolve_ref() clean-up. Signed-off-by: Junio C Hamano --- fsck-objects.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fsck-objects.c b/fsck-objects.c index 4d994f3fc8..456c17e2f6 100644 --- a/fsck-objects.c +++ b/fsck-objects.c @@ -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;