Skip to content

Commit 05b9425

Browse files
pks-tttaylorr
authored andcommitted
revision: move together exclusion-related functions
Move together the definitions of functions that handle exclusions of refs so that related functionality sits in a single place, only. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 9b67eb6 commit 05b9425

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

revision.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,14 +1517,6 @@ static void add_rev_cmdline_list(struct rev_info *revs,
15171517
}
15181518
}
15191519

1520-
struct all_refs_cb {
1521-
int all_flags;
1522-
int warned_bad_reflog;
1523-
struct rev_info *all_revs;
1524-
const char *name_for_errormsg;
1525-
struct worktree *wt;
1526-
};
1527-
15281520
int ref_excluded(struct string_list *ref_excludes, const char *path)
15291521
{
15301522
struct string_list_item *item;
@@ -1538,6 +1530,32 @@ int ref_excluded(struct string_list *ref_excludes, const char *path)
15381530
return 0;
15391531
}
15401532

1533+
void clear_ref_exclusion(struct string_list **ref_excludes_p)
1534+
{
1535+
if (*ref_excludes_p) {
1536+
string_list_clear(*ref_excludes_p, 0);
1537+
free(*ref_excludes_p);
1538+
}
1539+
*ref_excludes_p = NULL;
1540+
}
1541+
1542+
void add_ref_exclusion(struct string_list **ref_excludes_p, const char *exclude)
1543+
{
1544+
if (!*ref_excludes_p) {
1545+
CALLOC_ARRAY(*ref_excludes_p, 1);
1546+
(*ref_excludes_p)->strdup_strings = 1;
1547+
}
1548+
string_list_append(*ref_excludes_p, exclude);
1549+
}
1550+
1551+
struct all_refs_cb {
1552+
int all_flags;
1553+
int warned_bad_reflog;
1554+
struct rev_info *all_revs;
1555+
const char *name_for_errormsg;
1556+
struct worktree *wt;
1557+
};
1558+
15411559
static int handle_one_ref(const char *path, const struct object_id *oid,
15421560
int flag UNUSED,
15431561
void *cb_data)
@@ -1563,24 +1581,6 @@ static void init_all_refs_cb(struct all_refs_cb *cb, struct rev_info *revs,
15631581
cb->wt = NULL;
15641582
}
15651583

1566-
void clear_ref_exclusion(struct string_list **ref_excludes_p)
1567-
{
1568-
if (*ref_excludes_p) {
1569-
string_list_clear(*ref_excludes_p, 0);
1570-
free(*ref_excludes_p);
1571-
}
1572-
*ref_excludes_p = NULL;
1573-
}
1574-
1575-
void add_ref_exclusion(struct string_list **ref_excludes_p, const char *exclude)
1576-
{
1577-
if (!*ref_excludes_p) {
1578-
CALLOC_ARRAY(*ref_excludes_p, 1);
1579-
(*ref_excludes_p)->strdup_strings = 1;
1580-
}
1581-
string_list_append(*ref_excludes_p, exclude);
1582-
}
1583-
15841584
static void handle_refs(struct ref_store *refs,
15851585
struct rev_info *revs, unsigned flags,
15861586
int (*for_each)(struct ref_store *, each_ref_fn, void *))

0 commit comments

Comments
 (0)