commit-graph: close_commit_graph before shallow walk
Call close_commit_graph() when about to start a rev-list walk that includes shallow commits. This is necessary in code paths that "fake" shallow commits for the sake of fetch. Specifically, test 351 in t5500-fetch-pack.sh runs git fetch --shallow-exclude one origin with a file-based transfer. When the "remote" has a commit-graph, we do not prevent the commit-graph from being loaded, but then the commits are intended to be dynamically transferred into shallow commits during get_shallow_commits_by_rev_list(). By closing the commit-graph before this call, we prevent this interaction. 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
5cef295f28
commit
829a321569
@ -24,6 +24,7 @@
|
||||
#include "quote.h"
|
||||
#include "upload-pack.h"
|
||||
#include "serve.h"
|
||||
#include "commit-graph.h"
|
||||
|
||||
/* Remember to update object flag allocation in object.h */
|
||||
#define THEY_HAVE (1u << 11)
|
||||
@ -740,6 +741,7 @@ static void deepen_by_rev_list(int ac, const char **av,
|
||||
{
|
||||
struct commit_list *result;
|
||||
|
||||
close_commit_graph(the_repository);
|
||||
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
|
||||
send_shallow(result);
|
||||
free_commit_list(result);
|
||||
|
||||
Reference in New Issue
Block a user