diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-05-13 21:19:18 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-13 21:19:18 +0200 |
commit | 896833b2687ce09a4965e5b4f3992daad096a65b (patch) | |
tree | 5edc5ea6874a06b4f78856339b3fab204dcaaa96 /commit.c | |
parent | The eighth batch (diff) | |
parent | shallow: use struct 'shallow_lock' for additional safety (diff) | |
download | git-896833b2687ce09a4965e5b4f3992daad096a65b.tar.xz git-896833b2687ce09a4965e5b4f3992daad096a65b.zip |
Merge branch 'tb/shallow-cleanup'
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
Diffstat (limited to 'commit.c')
-rw-r--r-- | commit.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -20,6 +20,7 @@ #include "refs.h" #include "commit-reach.h" #include "run-command.h" +#include "shallow.h" static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **); @@ -110,7 +111,7 @@ static const unsigned char *commit_graft_sha1_access(size_t index, void *table) return commit_graft_table[index]->oid.hash; } -static int commit_graft_pos(struct repository *r, const unsigned char *sha1) +int commit_graft_pos(struct repository *r, const unsigned char *sha1) { return sha1_pos(sha1, r->parsed_objects->grafts, r->parsed_objects->grafts_nr, @@ -245,19 +246,6 @@ int for_each_commit_graft(each_commit_graft_fn fn, void *cb_data) return ret; } -int unregister_shallow(const struct object_id *oid) -{ - int pos = commit_graft_pos(the_repository, oid->hash); - if (pos < 0) - return -1; - if (pos + 1 < the_repository->parsed_objects->grafts_nr) - MOVE_ARRAY(the_repository->parsed_objects->grafts + pos, - the_repository->parsed_objects->grafts + pos + 1, - the_repository->parsed_objects->grafts_nr - pos - 1); - the_repository->parsed_objects->grafts_nr--; - return 0; -} - struct commit_buffer { void *buffer; unsigned long size; |