git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 10/19] commit: allow get_merge_bases_many_0 to handle arbitrary repositories

From
Stefan Beller <sbeller@google.com>
Date
Oct 11, 2018, 21:17 UTC
Message-ID
<20181011211754.31369-11-sbeller@google.com>
In-Reply-To
<20181011211754.31369-1-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 commit.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/commit.c b/commit.c
index f8a8844a72..b36c2aa0bf 100644
--- a/commit.c
+++ b/commit.c
@@ -1055,7 +1055,8 @@ static int remove_redundant(struct repository *r, struct commit **array, int cnt
 	return filled;
 }
 
-static struct commit_list *get_merge_bases_many_0(struct commit *one,
+static struct commit_list *get_merge_bases_many_0(struct repository *r,
+						  struct commit *one,
 						  int n,
 						  struct commit **twos,
 						  int cleanup)
@@ -1065,7 +1066,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
 	struct commit_list *result;
 	int cnt, i;
 
-	result = merge_bases_many(the_repository, one, n, twos);
+	result = merge_bases_many(r, one, n, twos);
 	for (i = 0; i < n; i++) {
 		if (one == twos[i])
 			return result;
@@ -1088,7 +1089,7 @@ static struct commit_list *get_merge_bases_many_0(struct commit *one,
 	clear_commit_marks(one, all_flags);
 	clear_commit_marks_many(n, twos, all_flags);
 
-	cnt = remove_redundant(the_repository, rslt, cnt);
+	cnt = remove_redundant(r, rslt, cnt);
 	result = NULL;
 	for (i = 0; i < cnt; i++)
 		commit_list_insert_by_date(rslt[i], &result);
@@ -1100,19 +1101,19 @@ struct commit_list *get_merge_bases_many(struct commit *one,
 					 int n,
 					 struct commit **twos)
 {
-	return get_merge_bases_many_0(one, n, twos, 1);
+	return get_merge_bases_many_0(the_repository, one, n, twos, 1);
 }
 
 struct commit_list *get_merge_bases_many_dirty(struct commit *one,
 					       int n,
 					       struct commit **twos)
 {
-	return get_merge_bases_many_0(one, n, twos, 0);
+	return get_merge_bases_many_0(the_repository, one, n, twos, 0);
 }
 
 struct commit_list *get_merge_bases(struct commit *one, struct commit *two)
 {
-	return get_merge_bases_many_0(one, 1, &two, 1);
+	return get_merge_bases_many_0(the_repository, one, 1, &two, 1);
 }
 
 /*
-- 
2.19.0
Previous: Stefan BellerNext: Stefan Beller
Message 16 of 37 in “Bring more repository handles into our code base”
  1. 00/19 Bring more repository handles into our code baseStefan Beller, Oct 11, 2018
  2. 01/19 sha1_file: allow read_object to read objects in arbitrary repositoriesStefan Beller, Oct 11, 2018
  3. 02/19 packfile: allow has_packed_and_bad to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  4. 03/19 object-store: allow read_object_file_extended to read from arbitrary repositoriesStefan Beller, Oct 11, 2018
  5. Jonathan TanOct 11, 2018
  6. 04/19 object-store: prepare read_object_file to deal with arbitrary repositoriesStefan Beller, Oct 11, 2018
  7. Jonathan TanOct 11, 2018
  8. Stefan BellerOct 11, 2018
  9. 05/19 object: parse_object to honor its repository argumentStefan Beller, Oct 11, 2018
  10. Jonathan TanOct 11, 2018
  11. Stefan BellerOct 13, 2018
  12. 06/19 commit: allow parse_commit* to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  13. 07/19 commit.c: allow paint_down_to_common to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  14. 08/19 commit.c: allow merge_bases_many to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  15. 09/19 commit.c: allow remove_redundant to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  16. 10/19 commit: allow get_merge_bases_many_0 to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  17. 11/19 commit: prepare get_merge_bases to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  18. 12/19 commit: prepare get_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  19. 13/19 commit: prepare in_merge_bases[_many] to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  20. 14/19 commit: prepare repo_unuse_commit_buffer to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  21. 15/19 commit: prepare logmsg_reencode to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  22. 16/19 pretty: prepare format_commit_message to handle arbitrary repositoriesStefan Beller, Oct 11, 2018
  23. Jonathan TanOct 11, 2018
  24. 17/19 submodule: use submodule repos for object lookupStefan Beller, Oct 11, 2018
  25. Jonathan TanOct 11, 2018
  26. Stefan BellerOct 13, 2018
  27. Stefan BellerOct 16, 2018
  28. Jonathan TanOct 16, 2018
  29. Stefan BellerOct 16, 2018
  30. 18/19 submodule: don't add submodule as odb for pushStefan Beller, Oct 11, 2018
  31. Jonathan TanOct 11, 2018
  32. Stefan BellerOct 11, 2018
  33. 19/19 Apply semantic patches from previous patchesStefan Beller, Oct 11, 2018
  34. Jonathan TanOct 11, 2018
  35. Junio C HamanoOct 11, 2018
  36. Jonathan NiederOct 12, 2018
  37. Stefan BellerOct 13, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.