summaryrefslogtreecommitdiff
path: root/merge-base.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 19:40:18 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-17 19:40:18 (GMT)
commit7d60ad7cc948b1b9e1066a3e740c91651bdc7e8d (patch)
tree7108636195bd22054fc889ab6eb87b2a0eb98e4a /merge-base.c
parent6683463ed6b2da9eed309c305806f9393d1ae728 (diff)
downloadgit-7d60ad7cc948b1b9e1066a3e740c91651bdc7e8d.zip
git-7d60ad7cc948b1b9e1066a3e740c91651bdc7e8d.tar.gz
git-7d60ad7cc948b1b9e1066a3e740c91651bdc7e8d.tar.bz2
Make "parse_commit" return the "struct revision" for the commit.
Also, make it a fatal error to pass in a non-commit object. The callers never checked, so better check here. This simplifies merge-base further. It's now so trivial that it's almost ridiculous.
Diffstat (limited to 'merge-base.c')
-rw-r--r--merge-base.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/merge-base.c b/merge-base.c
index 36ac420..dac5e4b 100644
--- a/merge-base.c
+++ b/merge-base.c
@@ -46,10 +46,7 @@ int main(int argc, char **argv)
* That's some time off, though, and in the meantime we know
* that we have a solution to the eventual expense.
*/
- parse_commit(rev1);
- parse_commit(rev2);
-
- common = common_parent(lookup_rev(rev1), lookup_rev(rev2));
+ common = common_parent(parse_commit(rev1), parse_commit(rev2));
if (!common)
die("no common parent found");
printf("%s\n", sha1_to_hex(common->sha1));