summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-06 16:31:17 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-06 16:31:17 (GMT)
commitf755494cec27fed8c9693bb91c26762061518b0b (patch)
tree9802a641645e28694535343c2e3e1fbe9733e5cf /commit.c
parentf6069c5995114d0fb2fba1140be5db717ff3b396 (diff)
downloadgit-f755494cec27fed8c9693bb91c26762061518b0b.zip
git-f755494cec27fed8c9693bb91c26762061518b0b.tar.gz
git-f755494cec27fed8c9693bb91c26762061518b0b.tar.bz2
Make "insert_by_date()" match "commit_list_insert()"
Same argument order, same return type. This allows us to use a function pointer to choose one over the other.
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/commit.c b/commit.c
index 03f8ca8..254c902 100644
--- a/commit.c
+++ b/commit.c
@@ -147,7 +147,7 @@ void free_commit_list(struct commit_list *list)
}
}
-void insert_by_date(struct commit_list **list, struct commit *item)
+struct commit_list * insert_by_date(struct commit *item, struct commit_list **list)
{
struct commit_list **pp = list;
struct commit_list *p;
@@ -157,7 +157,7 @@ void insert_by_date(struct commit_list **list, struct commit *item)
}
pp = &p->next;
}
- commit_list_insert(item, pp);
+ return commit_list_insert(item, pp);
}
@@ -165,7 +165,7 @@ void sort_by_date(struct commit_list **list)
{
struct commit_list *ret = NULL;
while (*list) {
- insert_by_date(&ret, (*list)->item);
+ insert_by_date((*list)->item, &ret);
*list = (*list)->next;
}
*list = ret;
@@ -186,7 +186,7 @@ struct commit *pop_most_recent_commit(struct commit_list **list,
parse_commit(commit);
if (!(commit->object.flags & mark)) {
commit->object.flags |= mark;
- insert_by_date(list, commit);
+ insert_by_date(commit, list);
}
parents = parents->next;
}