summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-06 20:40:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-10-06 20:40:11 (GMT)
commit921c795c25577e40df1f607a22748332bfb225ea (patch)
treee29b9b398d13aeb9b8053f220f584228a87f1b28 /revision.c
parent0785eb769886ae81e346df10e88bc49ffc0ac64e (diff)
parent10a0d6ae64ad4fec12ab2c1ed13d1791dde60371 (diff)
downloadgit-921c795c25577e40df1f607a22748332bfb225ea.zip
git-921c795c25577e40df1f607a22748332bfb225ea.tar.gz
git-921c795c25577e40df1f607a22748332bfb225ea.tar.bz2
Merge branch 'jt/add-submodule-odb-clean-up'
More code paths that use the hack to add submodule's object database to the set of alternate object store have been cleaned up. * jt/add-submodule-odb-clean-up: revision: remove "submodule" from opt struct repository: support unabsorbed in repo_submodule_init submodule: remove unnecessary unabsorbed fallback
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/revision.c b/revision.c
index 0dabb5a..7e7c41f 100644
--- a/revision.c
+++ b/revision.c
@@ -2563,8 +2563,7 @@ static int for_each_good_bisect_ref(struct ref_store *refs, each_ref_fn fn, void
return for_each_bisect_ref(refs, fn, cb_data, term_good);
}
-static int handle_revision_pseudo_opt(const char *submodule,
- struct rev_info *revs,
+static int handle_revision_pseudo_opt(struct rev_info *revs,
const char **argv, int *flags)
{
const char *arg = argv[0];
@@ -2572,7 +2571,7 @@ static int handle_revision_pseudo_opt(const char *submodule,
struct ref_store *refs;
int argcount;
- if (submodule) {
+ if (revs->repo != the_repository) {
/*
* We need some something like get_submodule_worktrees()
* before we can go through all worktrees of a submodule,
@@ -2581,9 +2580,8 @@ static int handle_revision_pseudo_opt(const char *submodule,
*/
if (!revs->single_worktree)
BUG("--single-worktree cannot be used together with submodule");
- refs = get_submodule_ref_store(submodule);
- } else
- refs = get_main_ref_store(revs->repo);
+ }
+ refs = get_main_ref_store(revs->repo);
/*
* NOTE!
@@ -2707,12 +2705,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
{
int i, flags, left, seen_dashdash, revarg_opt;
struct strvec prune_data = STRVEC_INIT;
- const char *submodule = NULL;
int seen_end_of_options = 0;
- if (opt)
- submodule = opt->submodule;
-
/* First, search for "--" */
if (opt && opt->assume_dashdash) {
seen_dashdash = 1;
@@ -2741,7 +2735,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (!seen_end_of_options && *arg == '-') {
int opts;
- opts = handle_revision_pseudo_opt(submodule,
+ opts = handle_revision_pseudo_opt(
revs, argv + i,
&flags);
if (opts > 0) {