summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2012-10-26 22:53:51 +0700
committerJeff King <peff@peff.net>2012-10-29 03:08:30 -0400
commitefc7df454e9ec8b730fb2293c8549cec43de6bfa (patch)
treebc96070114a2ca5820523944880f635910155d46
parentc43cb38612192fa45bf7ed981a98bc4ddb86ce75 (diff)
downloadgit-efc7df454e9ec8b730fb2293c8549cec43de6bfa.tar.gz
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 <pclouds@gmail.com> Signed-off-by: Jeff King <peff@peff.net>
-rw-r--r--bisect.h4
-rw-r--r--builtin/rev-list.c10
-rw-r--r--commit.c10
-rw-r--r--commit.h4
4 files changed, 14 insertions, 14 deletions
diff --git a/bisect.h b/bisect.h
index ec3c3ff007..2a6c831f3e 100644
--- a/bisect.h
+++ b/bisect.h
@@ -11,10 +11,6 @@ extern struct commit_list *filter_skipped(struct commit_list *list,
int *count,
int *skipped_first);
-extern void print_commit_list(struct commit_list *list,
- const char *format_cur,
- const char *format_last);
-
#define BISECT_SHOW_ALL (1<<0)
#define REV_LIST_QUIET (1<<1)
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index a0ec84e44b..67701be551 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -201,16 +201,6 @@ static void show_edge(struct commit *commit)
printf("-%s\n", sha1_to_hex(commit->object.sha1));
}
-void print_commit_list(struct commit_list *list,
- const char *format_cur,
- const char *format_last)
-{
- for ( ; list; list = list->next) {
- const char *format = list->next ? format_cur : format_last;
- printf(format, sha1_to_hex(list->item->object.sha1));
- }
-}
-
static void print_var_str(const char *var, const char *val)
{
printf("%s='%s'\n", var, val);
diff --git a/commit.c b/commit.c
index 213bc98c18..e8eb0aec55 100644
--- a/commit.c
+++ b/commit.c
@@ -1347,3 +1347,13 @@ struct commit_list **commit_list_append(struct commit *commit,
new->next = NULL;
return &new->next;
}
+
+void print_commit_list(struct commit_list *list,
+ const char *format_cur,
+ const char *format_last)
+{
+ for ( ; list; list = list->next) {
+ const char *format = list->next ? format_cur : format_last;
+ printf(format, sha1_to_hex(list->item->object.sha1));
+ }
+}
diff --git a/commit.h b/commit.h
index 9f2131318d..c4cd046160 100644
--- a/commit.h
+++ b/commit.h
@@ -222,4 +222,8 @@ struct commit *get_merge_parent(const char *name);
extern int parse_signed_commit(const unsigned char *sha1,
struct strbuf *message, struct strbuf *signature);
+extern void print_commit_list(struct commit_list *list,
+ const char *format_cur,
+ const char *format_last);
+
#endif /* COMMIT_H */