diff-merges: re-arrange functions to match the order they are called in

For clarity, define public functions in the order they are called, to
make logic inter-dependencies easier to grok.

Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Sergey Organov 2020-12-21 18:19:37 +03:00 коммит произвёл Junio C Hamano
Родитель 4f54544d73
Коммит 564a4fc847
2 изменённых файлов: 16 добавлений и 13 удалений

Просмотреть файл

@ -2,6 +2,10 @@
#include "revision.h"
/*
* Public functions. They are in the order they are called.
*/
void diff_merges_init_revs(struct rev_info *revs)
{
revs->ignore_merges = -1;
@ -46,16 +50,6 @@ int diff_merges_parse_opts(struct rev_info *revs, const char **argv)
return argcount;
}
void diff_merges_setup_revs(struct rev_info *revs)
{
if (revs->combine_merges && revs->ignore_merges < 0)
revs->ignore_merges = 0;
if (revs->ignore_merges < 0)
revs->ignore_merges = 1;
if (revs->combined_all_paths && !revs->combine_merges)
die("--combined-all-paths makes no sense without -c or --cc");
}
void diff_merges_default_to_first_parent(struct rev_info *revs)
{
if (revs->ignore_merges < 0) /* No -m */
@ -72,3 +66,13 @@ void diff_merges_default_to_dense_combined(struct rev_info *revs)
}
}
}
void diff_merges_setup_revs(struct rev_info *revs)
{
if (revs->combine_merges && revs->ignore_merges < 0)
revs->ignore_merges = 0;
if (revs->ignore_merges < 0)
revs->ignore_merges = 1;
if (revs->combined_all_paths && !revs->combine_merges)
die("--combined-all-paths makes no sense without -c or --cc");
}

Просмотреть файл

@ -13,11 +13,10 @@ void diff_merges_init_revs(struct rev_info *revs);
int diff_merges_parse_opts(struct rev_info *revs, const char **argv);
void diff_merges_setup_revs(struct rev_info *revs);
void diff_merges_default_to_first_parent(struct rev_info *revs);
void diff_merges_default_to_dense_combined(struct rev_info *revs);
void diff_merges_default_to_first_parent(struct rev_info *revs);
void diff_merges_setup_revs(struct rev_info *revs);
#endif