Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit efc7df4

Browse files
pcloudspeff
authored andcommitted
Move print_commit_list to libgit.a
This is used by bisect.c, part of libgit.a while it stays in builtin/rev-list.c. Move it to commit.c so that we won't get undefined reference if a program that uses libgit.a happens to pull it in. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Jeff King <[email protected]>
1 parent c43cb38 commit efc7df4

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

bisect.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ extern struct commit_list *filter_skipped(struct commit_list *list,
1111
int *count,
1212
int *skipped_first);
1313

14-
extern void print_commit_list(struct commit_list *list,
15-
const char *format_cur,
16-
const char *format_last);
17-
1814
#define BISECT_SHOW_ALL (1<<0)
1915
#define REV_LIST_QUIET (1<<1)
2016

builtin/rev-list.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,6 @@ static void show_edge(struct commit *commit)
201201
printf("-%s\n", sha1_to_hex(commit->object.sha1));
202202
}
203203

204-
void print_commit_list(struct commit_list *list,
205-
const char *format_cur,
206-
const char *format_last)
207-
{
208-
for ( ; list; list = list->next) {
209-
const char *format = list->next ? format_cur : format_last;
210-
printf(format, sha1_to_hex(list->item->object.sha1));
211-
}
212-
}
213-
214204
static void print_var_str(const char *var, const char *val)
215205
{
216206
printf("%s='%s'\n", var, val);

commit.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,3 +1347,13 @@ struct commit_list **commit_list_append(struct commit *commit,
13471347
new->next = NULL;
13481348
return &new->next;
13491349
}
1350+
1351+
void print_commit_list(struct commit_list *list,
1352+
const char *format_cur,
1353+
const char *format_last)
1354+
{
1355+
for ( ; list; list = list->next) {
1356+
const char *format = list->next ? format_cur : format_last;
1357+
printf(format, sha1_to_hex(list->item->object.sha1));
1358+
}
1359+
}

commit.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,8 @@ struct commit *get_merge_parent(const char *name);
222222

223223
extern int parse_signed_commit(const unsigned char *sha1,
224224
struct strbuf *message, struct strbuf *signature);
225+
extern void print_commit_list(struct commit_list *list,
226+
const char *format_cur,
227+
const char *format_last);
228+
225229
#endif /* COMMIT_H */

0 commit comments

Comments
 (0)