summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/refs.c b/refs.c
index 00174e9498..717aa54c03 100644
--- a/refs.c
+++ b/refs.c
@@ -2008,18 +2008,17 @@ static int pack_one_ref(struct ref_entry *entry, void *cb_data)
{
struct pack_refs_cb_data *cb = cb_data;
enum peel_status peel_status;
- int is_tag_ref;
-
- /* Do not pack symbolic or broken refs: */
- if ((entry->flag & REF_ISSYMREF) || !ref_resolves_to_object(entry))
- return 0;
- is_tag_ref = !prefixcmp(entry->name, "refs/tags/");
+ int is_tag_ref = !prefixcmp(entry->name, "refs/tags/");
/* ALWAYS pack refs that were already packed or are tags */
if (!(cb->flags & PACK_REFS_ALL) && !is_tag_ref &&
!(entry->flag & REF_ISPACKED))
return 0;
+ /* Do not pack symbolic or broken refs: */
+ if ((entry->flag & REF_ISSYMREF) || !ref_resolves_to_object(entry))
+ return 0;
+
peel_status = peel_entry(entry, 1);
if (peel_status != PEEL_PEELED && peel_status != PEEL_NON_TAG)
die("internal error peeling reference %s (%s)",