Thread (18 messages) flat view 18 messages, 3 authors, 2016-06-15
DORMANTno replies

Revision v7 of 3 in this series.

Revisions (3)
  1. v6 [diff vs current]
  2. v7 current
  3. v8 [diff vs current]

[PATCH v7 05/11] pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()

From: Michael Haggerty <hidden>
Date: 2016-06-15 23:07:13
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 refs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 480de9a..82129f0 100644
--- a/refs.c
+++ b/refs.c
@@ -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 */
-- 
2.6.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help