]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'tb/shallow-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2020 19:19:18 +0000 (12:19 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2020 19:19:18 +0000 (12:19 -0700)
Code cleanup.

* tb/shallow-cleanup:
  shallow: use struct 'shallow_lock' for additional safety
  shallow.h: document '{commit,rollback}_shallow_file'
  shallow: extract a header file for shallow-related functions
  commit: make 'commit_graft_pos' non-static

14 files changed:
1  2 
builtin/fetch.c
builtin/pack-objects.c
builtin/prune.c
builtin/receive-pack.c
builtin/repack.c
builtin/rev-parse.c
commit-graph.c
commit.c
environment.c
fetch-pack.c
git.c
send-pack.c
shallow.c
upload-pack.c

diff --cc builtin/fetch.c
Simple merge
Simple merge
diff --cc builtin/prune.c
index fd9acc722247ece74483f6a2a7674a4c5f712570,028ff786d62e5102c75e3327ee12413595923b5f..02c6ab7cbaafbac6492fd458bedc0f162e81d683
@@@ -6,8 -6,8 +6,9 @@@
  #include "reachable.h"
  #include "parse-options.h"
  #include "progress.h"
 +#include "prune-packed.h"
  #include "object-store.h"
+ #include "shallow.h"
  
  static const char * const prune_usage[] = {
        N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
Simple merge
index 1b686ee9cee7c13f7c0052f397e1006d079667a0,2550603608a332062bff04310a596a2004c90b50..df287739d9081cbccb203ca3f8cc744490e949ca
  #include "argv-array.h"
  #include "midx.h"
  #include "packfile.h"
 +#include "prune-packed.h"
  #include "object-store.h"
  #include "promisor-remote.h"
+ #include "shallow.h"
  
  static int delta_base_offset = 1;
  static int pack_kept_objects = -1;
Simple merge
diff --cc commit-graph.c
index 5ea0c8e15c65fd8d0a4828a532247f774b0ee679,d316de50217c5b25d9ca6da578ea08e3d3275999..e3420ddcbff5e829aa821d6c42c740e6eb819d37
  #include "hashmap.h"
  #include "replace-object.h"
  #include "progress.h"
 +#include "bloom.h"
 +#include "commit-slab.h"
+ #include "shallow.h"
  
 +void git_test_write_commit_graph_or_die(void)
 +{
 +      int flags = 0;
 +      if (!git_env_bool(GIT_TEST_COMMIT_GRAPH, 0))
 +              return;
 +
 +      if (git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
 +              flags = COMMIT_GRAPH_WRITE_BLOOM_FILTERS;
 +
 +      if (write_commit_graph_reachable(the_repository->objects->odb,
 +                                       flags, NULL))
 +              die("failed to write commit-graph under GIT_TEST_COMMIT_GRAPH");
 +}
 +
  #define GRAPH_SIGNATURE 0x43475048 /* "CGPH" */
  #define GRAPH_CHUNKID_OIDFANOUT 0x4f494446 /* "OIDF" */
  #define GRAPH_CHUNKID_OIDLOOKUP 0x4f49444c /* "OIDL" */
diff --cc commit.c
Simple merge
diff --cc environment.c
Simple merge
diff --cc fetch-pack.c
Simple merge
diff --cc git.c
Simple merge
diff --cc send-pack.c
index d1b7edc9957874dea1a1d1c8daf62e2ef2d7f8d8,e0ccfef75af93a5f400659d4f18cf83078442f37..0abee22283dae8ceba42eb4b9b5ecb4842c98984
  #include "quote.h"
  #include "transport.h"
  #include "version.h"
 -#include "sha1-array.h"
 +#include "oid-array.h"
  #include "gpg-interface.h"
  #include "cache.h"
+ #include "shallow.h"
  
  int option_parse_push_signed(const struct option *opt,
                             const char *arg, int unset)
diff --cc shallow.c
Simple merge
diff --cc upload-pack.c
Simple merge