X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-pack-refs.c;h=d080e30d67a913529d46e0da169faa4b0be75580;hb=240ba7f235c9b946678bd6d34826fb73ea8fd90e;hp=6de7128b9d8e98dcb9850d9dc932ca522c97473a;hpb=0f018baba654347b5ce746253b99d59707f80184;p=git.git diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c index 6de7128b9..d080e30d6 100644 --- a/builtin-pack-refs.c +++ b/builtin-pack-refs.c @@ -36,8 +36,10 @@ static int handle_one_ref(const char *path, const unsigned char *sha1, /* Do not pack the symbolic refs */ if ((flags & REF_ISSYMREF)) return 0; - is_tag_ref = !strncmp(path, "refs/tags/", 10); - if (!cb->all && !is_tag_ref) + is_tag_ref = !prefixcmp(path, "refs/tags/"); + + /* ALWAYS pack refs that were already packed or are tags */ + if (!cb->all && !is_tag_ref && !(flags & REF_ISPACKED)) return 0; fprintf(cb->refs_file, "%s %s\n", sha1_to_hex(sha1), path);