commit-reach: move ref_newer from remote.c
commit1d614d41e5fc030bc2f2799a58791aa912f78378
authorDerrick Stolee <dstolee@microsoft.com>
Fri, 20 Jul 2018 16:33:06 +0000 (20 16:33 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jul 2018 22:38:54 +0000 (20 15:38 -0700)
tree9f3c355e56968b1f3fcdbdfc318e8a65c8c0f100
parent6404355657fb3ec27668fb88c5175bb22aff3acc
commit-reach: move ref_newer from remote.c

There are several commit walks in the codebase. Group them together into
a new commit-reach.c file and corresponding header. After we group these
walks into one place, we can reduce duplicate logic by calling
equivalent methods.

The ref_newer() method is used by 'git push -f' to check if a force-push
is necessary. By making the method public, we make it possible to test
the method directly without setting up an envieronment where a 'git
push' call makes sense.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
commit-reach.c
commit-reach.h
remote.c
remote.h