Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
entry_matches(): inline function
author
Michael Haggerty
<mhagger@alum.mit.edu>
Mon, 11 May 2015 15:25:07 +0000
(17:25 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 11 May 2015 18:50:18 +0000
(11:50 -0700)
It wasn't pulling its weight. And in a moment we will need similar
tests that take a refname rather than a ref_entry as parameter, which
would have made entry_matches() even less useful.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
refs.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6075f30
)
diff --git
a/refs.c
b/refs.c
index faabd685c482bc76b5f45210f298675523f0fe41..6bdd34fc728ece31a9b0f64b29269222dcf98d60 100644
(file)
--- a/
refs.c
+++ b/
refs.c
@@
-841,11
+841,6
@@
static void prime_ref_dir(struct ref_dir *dir)
}
}
}
}
-static int entry_matches(struct ref_entry *entry, const struct string_list *list)
-{
- return list && string_list_has_string(list, entry->name);
-}
-
struct nonmatching_ref_data {
const struct string_list *skip;
struct ref_entry *found;
struct nonmatching_ref_data {
const struct string_list *skip;
struct ref_entry *found;
@@
-855,7
+850,7
@@
static int nonmatching_ref_fn(struct ref_entry *entry, void *vdata)
{
struct nonmatching_ref_data *data = vdata;
{
struct nonmatching_ref_data *data = vdata;
- if (
entry_matches(entry, data->skip
))
+ if (
data->skip && string_list_has_string(data->skip, entry->name
))
return 0;
data->found = entry;
return 0;
data->found = entry;
@@
-908,7
+903,7
@@
static int is_refname_available(const char *refname,
* prefix of refname; e.g., "refs/foo".
*/
struct ref_entry *entry = dir->entries[pos];
* prefix of refname; e.g., "refs/foo".
*/
struct ref_entry *entry = dir->entries[pos];
- if (
entry_matches(entry, skip
)) {
+ if (
skip && string_list_has_string(skip, entry->name
)) {
/*
* The reference we just found, e.g.,
* "refs/foo", is also in skip, so it
/*
* The reference we just found, e.g.,
* "refs/foo", is also in skip, so it