Skip to content

Commit 987f5a1

Browse files
bk2204gitster
authored andcommitted
reflog-walk: expose read_complete_reflog
In a future commit, we'll use this function and the corresponding free function to read the entire reflog. Expose it in the header so we can do so. Include the appropriate header files so that our header is complete. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bc7f7bc commit 987f5a1

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

reflog-walk.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,6 @@
99
#include "string-list.h"
1010
#include "reflog-walk.h"
1111

12-
struct complete_reflogs {
13-
char *ref;
14-
char *short_ref;
15-
struct reflog_info {
16-
struct object_id ooid, noid;
17-
char *email;
18-
timestamp_t timestamp;
19-
int tz;
20-
char *message;
21-
} *items;
22-
int nr, alloc;
23-
};
24-
2512
static int read_one_reflog(struct object_id *ooid, struct object_id *noid,
2613
const char *email, timestamp_t timestamp, int tz,
2714
const char *message, void *cb_data)
@@ -41,7 +28,7 @@ static int read_one_reflog(struct object_id *ooid, struct object_id *noid,
4128
return 0;
4229
}
4330

44-
static void free_complete_reflog(struct complete_reflogs *array)
31+
void free_complete_reflog(struct complete_reflogs *array)
4532
{
4633
int i;
4734

@@ -64,7 +51,7 @@ static void complete_reflogs_clear(void *util, const char *str UNUSED)
6451
free_complete_reflog(array);
6552
}
6653

67-
static struct complete_reflogs *read_complete_reflog(const char *ref)
54+
struct complete_reflogs *read_complete_reflog(const char *ref)
6855
{
6956
struct complete_reflogs *reflogs =
7057
xcalloc(1, sizeof(struct complete_reflogs));

reflog-walk.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
11
#ifndef REFLOG_WALK_H
22
#define REFLOG_WALK_H
33

4+
#include "git-compat-util.h"
5+
#include "hash.h"
6+
47
struct commit;
58
struct reflog_walk_info;
69
struct date_mode;
10+
struct complete_reflogs {
11+
char *ref;
12+
char *short_ref;
13+
struct reflog_info {
14+
struct object_id ooid, noid;
15+
char *email;
16+
timestamp_t timestamp;
17+
int tz;
18+
char *message;
19+
} *items;
20+
int nr, alloc;
21+
};
722

823
void init_reflog_walk(struct reflog_walk_info **info);
924
void reflog_walk_info_release(struct reflog_walk_info *info);
@@ -24,4 +39,7 @@ int reflog_walk_empty(struct reflog_walk_info *walk);
2439

2540
struct commit *next_reflog_entry(struct reflog_walk_info *reflog_info);
2641

42+
void free_complete_reflog(struct complete_reflogs *array);
43+
struct complete_reflogs *read_complete_reflog(const char *ref);
44+
2745
#endif

0 commit comments

Comments
 (0)