summaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-19 00:14:04 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-20 17:22:10 -0800
commit2ecd2bbcbe5335c1d9209b6ce28513e4e9d3491b (patch)
tree86d8f3803b12256607153517b804f8a80d6a332c /builtin-branch.c
parente29cb53a8b6aa1256221207b14a1c8ef72f69d9f (diff)
downloadgit-2ecd2bbcbe5335c1d9209b6ce28513e4e9d3491b.tar.gz
Move in_merge_bases() to commit.c
This reasonably useful function was hidden inside builtin-branch.c
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index 903d5cf056..745ee04d6e 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -74,25 +74,6 @@ const char *branch_get_color(enum color_branch ix)
return "";
}
-static int in_merge_bases(const unsigned char *sha1,
- struct commit *rev1,
- struct commit *rev2)
-{
- struct commit_list *bases, *b;
- int ret = 0;
-
- bases = get_merge_bases(rev1, rev2, 1);
- for (b = bases; b; b = b->next) {
- if (!hashcmp(sha1, b->item->object.sha1)) {
- ret = 1;
- break;
- }
- }
-
- free_commit_list(bases);
- return ret;
-}
-
static int delete_branches(int argc, const char **argv, int force, int kinds)
{
struct commit *rev, *head_rev = head_rev;
@@ -153,7 +134,7 @@ static int delete_branches(int argc, const char **argv, int force, int kinds)
*/
if (!force &&
- !in_merge_bases(sha1, rev, head_rev)) {
+ !in_merge_bases(rev, head_rev)) {
error("The branch '%s' is not a strict subset of "
"your current HEAD.\n"
"If you are sure you want to delete it, "