diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-04-13 22:01:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-04-14 08:56:08 +0200 |
commit | 296a1438455d366475570ac49afb466f591417dc (patch) | |
tree | 429cb937e28df8861fe7451b1195c871194df4eb /revision.c | |
parent | revisions API users: add straightforward release_revisions() (diff) | |
download | git-296a1438455d366475570ac49afb466f591417dc.tar.xz git-296a1438455d366475570ac49afb466f591417dc.zip |
revision.[ch]: document and move code declared around "init"
A subsequent commit will add "REV_INFO_INIT" macro adjacent to
repo_init_revisions(), unfortunately between the "struct rev_info"
itself and that function we've added various miscellaneous code
between the two over the years.
Let's move that code either lower in revision.h, giving it API docs
while we're at it, or in cases where it wasn't public API at all move
it into revision.c No lines of code are changed here, only moved
around. The only changes are the addition of new API comments.
The "tree_difference" variable could also be declared like this, which
I think would be a lot clearer, but let's leave that for now to keep
this a move-only change:
static enum {
REV_TREE_SAME,
REV_TREE_NEW, /* Only new files */
REV_TREE_OLD, /* Only files removed */
REV_TREE_DIFFERENT, /* Mixed changes */
} tree_difference = REV_TREE_SAME;
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 5dd4b2e910..472fff1e0a 100644 --- a/revision.c +++ b/revision.c @@ -606,6 +606,10 @@ static struct commit *one_relevant_parent(const struct rev_info *revs, * * 2. We saw anything except REV_TREE_NEW. */ +#define REV_TREE_SAME 0 +#define REV_TREE_NEW 1 /* Only new files */ +#define REV_TREE_OLD 2 /* Only files removed */ +#define REV_TREE_DIFFERENT 3 /* Mixed changes */ static int tree_difference = REV_TREE_SAME; static void file_add_remove(struct diff_options *options, |