summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-08-26 20:32:21 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-26 20:32:22 +0200
commit2ff26d228600848ecf3d44b3796beee310ebcccf (patch)
tree1753564cddbf3968d05dec56308fd82e9ee47213
parentMerge branch 'tb/pseudo-merge-bitmap-fixes' (diff)
parentdiff-lib: drop unused index argument from get_stat_data() (diff)
downloadgit-2ff26d228600848ecf3d44b3796beee310ebcccf.tar.xz
git-2ff26d228600848ecf3d44b3796beee310ebcccf.zip
Merge branch 'jk/drop-unused-parameters'
Drop unused parameters from functions. * jk/drop-unused-parameters: diff-lib: drop unused index argument from get_stat_data() ref-filter: drop unused parameters from email_atom_option_parser() pack-bitmap: drop unused parameters from select_pseudo_merges() pack-bitmap: load writer config from repository parameter refs: drop some unused parameters from create_symref_lock()
-rw-r--r--diff-lib.c9
-rw-r--r--pack-bitmap-write.c7
-rw-r--r--pseudo-merge.c8
-rw-r--r--pseudo-merge.h6
-rw-r--r--ref-filter.c5
-rw-r--r--refs/files-backend.c8
6 files changed, 18 insertions, 25 deletions
diff --git a/diff-lib.c b/diff-lib.c
index 7a1eb63757..a680768ee7 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -308,8 +308,7 @@ static void diff_index_show_file(struct rev_info *revs,
oid, oid_valid, ce->name, dirty_submodule);
}
-static int get_stat_data(const struct index_state *istate,
- const struct cache_entry *ce,
+static int get_stat_data(const struct cache_entry *ce,
const struct object_id **oidp,
unsigned int *modep,
int cached, int match_missing,
@@ -352,7 +351,6 @@ static void show_new_file(struct rev_info *revs,
const struct object_id *oid;
unsigned int mode;
unsigned dirty_submodule = 0;
- struct index_state *istate = revs->diffopt.repo->index;
if (new_file && S_ISSPARSEDIR(new_file->ce_mode)) {
diff_tree_oid(NULL, &new_file->oid, new_file->name, &revs->diffopt);
@@ -363,7 +361,7 @@ static void show_new_file(struct rev_info *revs,
* New file in the index: it might actually be different in
* the working tree.
*/
- if (get_stat_data(istate, new_file, &oid, &mode, cached, match_missing,
+ if (get_stat_data(new_file, &oid, &mode, cached, match_missing,
&dirty_submodule, &revs->diffopt) < 0)
return;
@@ -379,7 +377,6 @@ static int show_modified(struct rev_info *revs,
unsigned int mode, oldmode;
const struct object_id *oid;
unsigned dirty_submodule = 0;
- struct index_state *istate = revs->diffopt.repo->index;
assert(S_ISSPARSEDIR(old_entry->ce_mode) ==
S_ISSPARSEDIR(new_entry->ce_mode));
@@ -395,7 +392,7 @@ static int show_modified(struct rev_info *revs,
return 0;
}
- if (get_stat_data(istate, new_entry, &oid, &mode, cached, match_missing,
+ if (get_stat_data(new_entry, &oid, &mode, cached, match_missing,
&dirty_submodule, &revs->diffopt) < 0) {
if (report_missing)
diff_index_show_file(revs, "-", old_entry,
diff --git a/pack-bitmap-write.c b/pack-bitmap-write.c
index 923f793cec..4dc0fe8e40 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -53,7 +53,7 @@ void bitmap_writer_init(struct bitmap_writer *writer, struct repository *r,
string_list_init_dup(&writer->pseudo_merge_groups);
- load_pseudo_merges_from_config(&writer->pseudo_merge_groups);
+ load_pseudo_merges_from_config(r, &writer->pseudo_merge_groups);
}
static void free_pseudo_merge_commit_idx(struct pseudo_merge_commit_idx *idx)
@@ -695,8 +695,7 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
for (i = 0; i < indexed_commits_nr; ++i)
bitmap_writer_push_commit(writer, indexed_commits[i], 0);
- select_pseudo_merges(writer, indexed_commits,
- indexed_commits_nr);
+ select_pseudo_merges(writer);
return;
}
@@ -738,7 +737,7 @@ void bitmap_writer_select_commits(struct bitmap_writer *writer,
stop_progress(&writer->progress);
- select_pseudo_merges(writer, indexed_commits, indexed_commits_nr);
+ select_pseudo_merges(writer);
}
diff --git a/pseudo-merge.c b/pseudo-merge.c
index 0c11b0ab3d..10ebd9a4e9 100644
--- a/pseudo-merge.c
+++ b/pseudo-merge.c
@@ -183,11 +183,12 @@ done:
return ret;
}
-void load_pseudo_merges_from_config(struct string_list *list)
+void load_pseudo_merges_from_config(struct repository *r,
+ struct string_list *list)
{
struct string_list_item *item;
- git_config(pseudo_merge_config, list);
+ repo_config(r, pseudo_merge_config, list);
for_each_string_list_item(item, list) {
struct pseudo_merge_group *group = item->util;
@@ -429,8 +430,7 @@ static void sort_pseudo_merge_matches(struct pseudo_merge_matches *matches)
QSORT(matches->unstable, matches->unstable_nr, commit_date_cmp);
}
-void select_pseudo_merges(struct bitmap_writer *writer,
- struct commit **commits, size_t commits_nr)
+void select_pseudo_merges(struct bitmap_writer *writer)
{
struct progress *progress = NULL;
uint32_t i;
diff --git a/pseudo-merge.h b/pseudo-merge.h
index 2aca01d056..4b5febaa63 100644
--- a/pseudo-merge.h
+++ b/pseudo-merge.h
@@ -10,6 +10,7 @@ struct commit;
struct string_list;
struct bitmap_index;
struct bitmap_writer;
+struct repository;
/*
* A pseudo-merge group tracks the set of non-bitmapped reference tips
@@ -72,7 +73,7 @@ struct pseudo_merge_matches {
* entry keys are the pseudo-merge group names, and the values are
* pointers to the pseudo_merge_group structure itself.
*/
-void load_pseudo_merges_from_config(struct string_list *list);
+void load_pseudo_merges_from_config(struct repository *r, struct string_list *list);
/*
* A pseudo-merge commit index (pseudo_merge_commit_idx) maps a
@@ -94,8 +95,7 @@ struct pseudo_merge_commit_idx {
*
* Optionally shows a progress meter.
*/
-void select_pseudo_merges(struct bitmap_writer *writer,
- struct commit **commits, size_t commits_nr);
+void select_pseudo_merges(struct bitmap_writer *writer);
/*
* Represents a serialized view of a file containing pseudo-merge(s)
diff --git a/ref-filter.c b/ref-filter.c
index 6d8b591930..2d7a65a56b 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -742,8 +742,7 @@ static int person_name_atom_parser(struct ref_format *format UNUSED,
return 0;
}
-static int email_atom_option_parser(struct used_atom *atom,
- const char **arg, struct strbuf *err)
+static int email_atom_option_parser(const char **arg)
{
if (!*arg)
return EO_RAW;
@@ -761,7 +760,7 @@ static int person_email_atom_parser(struct ref_format *format UNUSED,
const char *arg, struct strbuf *err)
{
for (;;) {
- int opt = email_atom_option_parser(atom, &arg, err);
+ int opt = email_atom_option_parser(&arg);
const char *bad_arg = arg;
if (opt < 0)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 8d6ec9458d..1cff65f6ae 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1961,9 +1961,8 @@ static int create_ref_symlink(struct ref_lock *lock, const char *target)
return ret;
}
-static int create_symref_lock(struct files_ref_store *refs,
- struct ref_lock *lock, const char *refname,
- const char *target, struct strbuf *err)
+static int create_symref_lock(struct ref_lock *lock, const char *target,
+ struct strbuf *err)
{
if (!fdopen_lock_file(&lock->lk, "w")) {
strbuf_addf(err, "unable to fdopen %s: %s",
@@ -2579,8 +2578,7 @@ static int lock_ref_for_update(struct files_ref_store *refs,
}
if (update->new_target && !(update->flags & REF_LOG_ONLY)) {
- if (create_symref_lock(refs, lock, update->refname,
- update->new_target, err)) {
+ if (create_symref_lock(lock, update->new_target, err)) {
ret = TRANSACTION_GENERIC_ERROR;
goto out;
}