diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2015-11-10 12:42:34 +0100 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-11-20 04:52:01 -0500 |
commit | a935ebd4a7df505da819371ef10add6ad7bd77d7 (patch) | |
tree | 34b2b1b33ff022ea51667b29024675aa635fadea /refs.c | |
parent | f4a5721ccb73efe33d345190f38058b45eaadca8 (diff) | |
download | git-a935ebd4a7df505da819371ef10add6ad7bd77d7.tar.gz |
pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()
is_per_worktree_ref() will soon be made private, so use the public
interface, ref_type(), in its place. And now that we're using
ref_type(), we can make it clear that we won't pack pseudorefs. This was
the case before, but due to the not-so-obvious reason that this function
is applied to references via the loose reference cache, which only
includes references that live inside "refs/".
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -2671,8 +2671,6 @@ struct pack_refs_cb_data { struct ref_to_prune *ref_to_prune; }; -static int is_per_worktree_ref(const char *refname); - /* * An each_ref_entry_fn that is run over loose references only. If * the loose reference can be packed, add an entry in the packed ref @@ -2687,7 +2685,7 @@ static int pack_if_possible_fn(struct ref_entry *entry, void *cb_data) int is_tag_ref = starts_with(entry->name, "refs/tags/"); /* Do not pack per-worktree refs: */ - if (is_per_worktree_ref(entry->name)) + if (ref_type(entry->name) != REF_TYPE_NORMAL) return 0; /* ALWAYS pack tags */ |