mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
replay: small set of cleanups
Perform a small set of cleanups so that the "replay" logic compiles with "-Wsign-compare" and doesn't use `the_repository` anymore. Note that there are still some implicit dependencies on `the_repository`, e.g. because we use `get_commit_output_encoding()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
97d9916065
commit
6244216971
11
replay.c
11
replay.c
@ -1,5 +1,4 @@
|
||||
#define USE_THE_REPOSITORY_VARIABLE
|
||||
#define DISABLE_SIGN_COMPARE_WARNINGS
|
||||
|
||||
#include "git-compat-util.h"
|
||||
#include "environment.h"
|
||||
@ -79,7 +78,7 @@ static struct commit *create_commit(struct repository *repo,
|
||||
obj = parse_object(repo, &ret);
|
||||
|
||||
out:
|
||||
repo_unuse_commit_buffer(the_repository, based_on, message);
|
||||
repo_unuse_commit_buffer(repo, based_on, message);
|
||||
free_commit_extra_headers(extra);
|
||||
free_commit_list(parents);
|
||||
strbuf_release(&msg);
|
||||
@ -91,16 +90,14 @@ struct ref_info {
|
||||
struct commit *onto;
|
||||
struct strset positive_refs;
|
||||
struct strset negative_refs;
|
||||
int positive_refexprs;
|
||||
int negative_refexprs;
|
||||
size_t positive_refexprs;
|
||||
size_t negative_refexprs;
|
||||
};
|
||||
|
||||
static void get_ref_information(struct repository *repo,
|
||||
struct rev_cmdline_info *cmd_info,
|
||||
struct ref_info *ref_info)
|
||||
{
|
||||
int i;
|
||||
|
||||
ref_info->onto = NULL;
|
||||
strset_init(&ref_info->positive_refs);
|
||||
strset_init(&ref_info->negative_refs);
|
||||
@ -122,7 +119,7 @@ static void get_ref_information(struct repository *repo,
|
||||
* the second because they'd likely just be replaying commits on top
|
||||
* of the same commit and not making any difference.
|
||||
*/
|
||||
for (i = 0; i < cmd_info->nr; i++) {
|
||||
for (size_t i = 0; i < cmd_info->nr; i++) {
|
||||
struct rev_cmdline_entry *e = cmd_info->rev + i;
|
||||
struct object_id oid;
|
||||
const char *refexpr = e->name;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user