summaryrefslogtreecommitdiff
path: root/show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-09-08 12:15:52 -0700
committerJunio C Hamano <junkio@cox.net>2005-09-08 12:15:52 -0700
commit2f0f8b71ee45bcf91c2de480474a26030596fe3c (patch)
tree11a018cb02c52f3d18a8ca7fa7f6625303ab8e75 /show-branch.c
parent35ef3a4c63d6b60cda8f26c842c0efee8d2cb5cc (diff)
downloadgit-2f0f8b71ee45bcf91c2de480474a26030596fe3c.tar.gz
Show all merge-base candidates from show-branch --merge-base
This would make things easier to use for Octopus. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'show-branch.c')
-rw-r--r--show-branch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/show-branch.c b/show-branch.c
index 8b37aebb01..ccb0c73bf9 100644
--- a/show-branch.c
+++ b/show-branch.c
@@ -4,7 +4,7 @@
#include "refs.h"
static const char show_branch_usage[] =
-"git-show-branch [--all] [--heads] [--tags] [--more=count] [<refs>...]";
+"git-show-branch [--all] [--heads] [--tags] [--more=count] [--merge-base] [<refs>...]";
#define UNINTERESTING 01
@@ -291,6 +291,7 @@ static int show_merge_base(struct commit_list *seen, int num_rev)
{
int all_mask = ((1u << (REV_SHIFT + num_rev)) - 1);
int all_revs = all_mask & ~((1u << REV_SHIFT) - 1);
+ int exit_status = 1;
while (seen) {
struct commit *commit = pop_one_commit(&seen);
@@ -298,10 +299,11 @@ static int show_merge_base(struct commit_list *seen, int num_rev)
if (!(flags & UNINTERESTING) &&
((flags & all_revs) == all_revs)) {
puts(sha1_to_hex(commit->object.sha1));
- return 0;
+ exit_status = 0;
+ commit->object.flags |= UNINTERESTING;
}
}
- return 1;
+ return exit_status;
}
int main(int ac, char **av)