mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
6404355657
commit
1d614d41e5
@@ -39,4 +39,6 @@ struct commit_list *reduce_heads(struct commit_list *heads);
|
||||
*/
|
||||
void reduce_heads_replace(struct commit_list **heads);
|
||||
|
||||
int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user