From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: johannes.schindelin@gmx.de, avarab@gmail.com,
Junio C Hamano <gitster@pobox.com>,
Derrick Stolee <dstolee@microsoft.com>
Subject: [PATCH 1/3] commit-graph: use raw_object_store when closing
Date: Fri, 17 May 2019 11:41:47 -0700 (PDT) [thread overview]
Message-ID: <9ff662e5e94d4a157c27e066ee4d01a04f00c295.1558118506.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.208.git.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
The close_commit_graph() method took a repository struct, but then
only uses the raw_object_store within. Change the function prototype
to make the method more flexible.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
commit-graph.c | 8 ++++----
commit-graph.h | 2 +-
upload-pack.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/commit-graph.c b/commit-graph.c
index 7723156964..e777e269aa 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -359,10 +359,10 @@ int generation_numbers_enabled(struct repository *r)
return !!first_generation;
}
-void close_commit_graph(struct repository *r)
+void close_commit_graph(struct raw_object_store *o)
{
- free_commit_graph(r->objects->commit_graph);
- r->objects->commit_graph = NULL;
+ free_commit_graph(o->commit_graph);
+ o->commit_graph = NULL;
}
static int bsearch_graph(struct commit_graph *g, struct object_id *oid, uint32_t *pos)
@@ -1086,7 +1086,7 @@ static int write_commit_graph_file(struct write_commit_graph_context *ctx)
stop_progress(&ctx->progress);
strbuf_release(&progress_title);
- close_commit_graph(ctx->r);
+ close_commit_graph(ctx->r->objects);
finalize_hashfile(f, NULL, CSUM_HASH_IN_STREAM | CSUM_FSYNC);
commit_lock_file(&lk);
diff --git a/commit-graph.h b/commit-graph.h
index 70f4caf0c7..afa3633592 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -76,7 +76,7 @@ int write_commit_graph(const char *obj_dir,
int verify_commit_graph(struct repository *r, struct commit_graph *g);
-void close_commit_graph(struct repository *);
+void close_commit_graph(struct raw_object_store *);
void free_commit_graph(struct commit_graph *);
#endif
diff --git a/upload-pack.c b/upload-pack.c
index d098ef5982..b51bed21e4 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -717,7 +717,7 @@ static void deepen_by_rev_list(struct packet_writer *writer, int ac,
{
struct commit_list *result;
- close_commit_graph(the_repository);
+ close_commit_graph(the_repository->objects);
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
send_shallow(writer, result);
free_commit_list(result);
--
gitgitgadget
next prev parent reply other threads:[~2019-05-17 18:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-17 18:41 [PATCH 0/3] Close commit-graph before calling 'gc' Derrick Stolee via GitGitGadget
2019-05-17 18:41 ` Derrick Stolee via GitGitGadget [this message]
2019-05-17 18:41 ` [PATCH 2/3] packfile: close commit-graph in close_all_packs Derrick Stolee via GitGitGadget
2019-05-17 18:41 ` [PATCH 3/3] packfile: close_all_packs to close_object_store Derrick Stolee via GitGitGadget
2019-05-20 10:01 ` Johannes Schindelin
2019-05-20 11:55 ` Derrick Stolee
2019-05-28 16:29 ` Junio C Hamano
2019-05-19 2:04 ` [PATCH 0/3] Close commit-graph before calling 'gc' Junio C Hamano
2019-05-20 10:13 ` Johannes Schindelin
2019-05-20 11:05 ` Derrick Stolee
2019-05-20 9:40 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9ff662e5e94d4a157c27e066ee4d01a04f00c295.1558118506.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=avarab@gmail.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).