Merge branch 'ds/close-object-store' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 29 Jul 2019 19:38:22 +0000 (12:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jul 2019 19:38:22 +0000 (12:38 -0700)
The commit-graph file is now part of the "files that the runtime
may keep open file descriptors on, all of which would need to be
closed when done with the object store", and the file descriptor to
an existing commit-graph file now is closed before "gc" finalizes a
new instance to replace it.

* ds/close-object-store:
packfile: rename close_all_packs to close_object_store
packfile: close commit-graph in close_all_packs
commit-graph: use raw_object_store when closing
commit-graph: extract write_commit_graph_file()
commit-graph: extract copy_oids_to_commits()
commit-graph: extract count_distinct_commits()
commit-graph: extract fill_oids_from_all_packs()
commit-graph: extract fill_oids_from_commit_hex()
commit-graph: extract fill_oids_from_packs()
commit-graph: create write_commit_graph_context
commit-graph: remove Future Work section
commit-graph: collapse parameters into flags
commit-graph: return with errors during write
commit-graph: fix the_repository reference

15 files changed:
1  2 
builtin/am.c
builtin/clone.c
builtin/commit.c
builtin/fetch.c
builtin/gc.c
builtin/merge.c
builtin/rebase.c
builtin/receive-pack.c
builtin/repack.c
commit-graph.c
commit.c
packfile.c
packfile.h
t/t5318-commit-graph.sh
upload-pack.c
diff --cc builtin/am.c
Simple merge
diff --cc builtin/clone.c
Simple merge
Simple merge
diff --cc builtin/fetch.c
Simple merge
diff --cc builtin/gc.c
Simple merge
diff --cc builtin/merge.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc commit-graph.c
Simple merge
diff --cc commit.c
Simple merge
diff --cc packfile.c
Simple merge
diff --cc packfile.h
index b678d35c0b6df11623f2d29f7b7ea7dfe0e1bea1,e95e389eb804e55cf1357cdefddebf9f3f653965..81e868d55a9b1f1aeaafa4925a72ae5c53af86e9
@@@ -81,19 -74,17 +81,19 @@@ int open_pack_index(struct packed_git *
   * munmap the index file for the specified packfile (if it is
   * currently mmapped).
   */
 -extern void close_pack_index(struct packed_git *);
 +void close_pack_index(struct packed_git *);
 +
 +int close_pack_fd(struct packed_git *p);
  
 -extern uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
 +uint32_t get_pack_fanout(struct packed_git *p, uint32_t value);
  
 -extern unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
 -extern void close_pack_windows(struct packed_git *);
 -extern void close_pack(struct packed_git *);
 -extern void close_object_store(struct raw_object_store *o);
 -extern void unuse_pack(struct pack_window **);
 -extern void clear_delta_base_cache(void);
 -extern struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
 +unsigned char *use_pack(struct packed_git *, struct pack_window **, off_t, unsigned long *);
 +void close_pack_windows(struct packed_git *);
 +void close_pack(struct packed_git *);
- void close_all_packs(struct raw_object_store *o);
++void close_object_store(struct raw_object_store *o);
 +void unuse_pack(struct pack_window **);
 +void clear_delta_base_cache(void);
 +struct packed_git *add_packed_git(const char *path, size_t path_len, int local);
  
  /*
   * Make sure that a pointer access into an mmap'd index file is within bounds,
Simple merge
diff --cc upload-pack.c
Simple merge