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

[PATCH 10/19] shallow: add repository argument to check_shallow_file_for_update

From
Stefan Beller <sbeller@google.com>
Date
May 15, 2018, 23:42 UTC
Message-ID
<20180515234233.143708-11-sbeller@google.com>
In-Reply-To
<20180515234233.143708-1-sbeller@google.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
---
 shallow.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/shallow.c b/shallow.c
index 0fadd5330d2..0028e4ea776 100644
--- a/shallow.c
+++ b/shallow.c
@@ -217,7 +217,8 @@ struct commit_list *get_shallow_commits_by_rev_list(int ac, const char **av,
 	return result;
 }
 
-static void check_shallow_file_for_update(void)
+#define check_shallow_file_for_update(r) check_shallow_file_for_update_##r()
+static void check_shallow_file_for_update_the_repository(void)
 {
 	if (is_shallow == -1)
 		die("BUG: shallow must be initialized by now");
@@ -319,7 +320,7 @@ void setup_alternate_shallow(struct lock_file *shallow_lock,
 
 	fd = hold_lock_file_for_update(shallow_lock, git_path_shallow(),
 				       LOCK_DIE_ON_ERROR);
-	check_shallow_file_for_update();
+	check_shallow_file_for_update(the_repository);
 	if (write_shallow_commits(&sb, 0, extra)) {
 		if (write_in_full(fd, sb.buf, sb.len) < 0)
 			die_errno("failed to write to %s",
@@ -366,7 +367,7 @@ void prune_shallow(int show_only)
 	}
 	fd = hold_lock_file_for_update(&shallow_lock, git_path_shallow(),
 				       LOCK_DIE_ON_ERROR);
-	check_shallow_file_for_update();
+	check_shallow_file_for_update(the_repository);
 	if (write_shallow_commits_1(&sb, 0, NULL, SEEN_ONLY)) {
 		if (write_in_full(fd, sb.buf, sb.len) < 0)
 			die_errno("failed to write to %s",
-- 
2.17.0.582.gccdcbd54c44.dirty
Previous: Stefan BellerNext: Stefan Beller
Message 16 of 40 in “object store: grafts and shallow.”
  1. 00/19 object store: grafts and shallow.Stefan Beller, May 15, 2018
  2. 02/19 object: move grafts to object parserStefan Beller, May 15, 2018
  3. 05/19 commit: add repository argument to read_graft_fileStefan Beller, May 15, 2018
  4. 06/19 commit: add repository argument to prepare_commit_graftStefan Beller, May 15, 2018
  5. 09/19 shallow: add repository argument to register_shallowStefan Beller, May 15, 2018
  6. 11/19 shallow: add repository argument to is_repository_shallowStefan Beller, May 15, 2018
  7. 13/19 commit: convert register_commit_graft to handle arbitrary repositoriesStefan Beller, May 15, 2018
  8. 15/19 cache: convert get_graft_file to handle arbitrary repositoriesStefan Beller, May 15, 2018
  9. 16/19 path.c: migrate git_path_ to take a repository argumentStefan Beller, May 15, 2018
  10. 19/19 commit: allow lookup_commit_graft to handle arbitrary repositoriesStefan Beller, May 15, 2018
  11. 18/19 commit: allow prepare_commit_graft to handle arbitrary repositoriesStefan Beller, May 15, 2018
  12. 12/19 commit: convert commit_graft_pos() to handle arbitrary repositoriesStefan Beller, May 15, 2018
  13. 14/19 commit: convert read_graft_file to handle arbitrary repositoriesStefan Beller, May 15, 2018
  14. 17/19 shallow: migrate shallow information into the object parserStefan Beller, May 15, 2018
  15. 07/19 commit: add repository argument to lookup_commit_graftStefan Beller, May 15, 2018
  16. 10/19 shallow: add repository argument to check_shallow_file_for_updateStefan Beller, May 15, 2018
  17. 08/19 shallow: add repository argument to set_alternate_shallow_fileStefan Beller, May 15, 2018
  18. 03/19 commit: add repository argument to commit_graft_posStefan Beller, May 15, 2018
  19. 04/19 commit: add repository argument to register_commit_graftStefan Beller, May 15, 2018
  20. 01/19 object-store: move object access functions to object-store.hStefan Beller, May 15, 2018
  21. 00/19 object store: grafts and shallow.Stefan Beller, May 17, 2018
  22. 02/19 object: move grafts to object parserStefan Beller, May 17, 2018
  23. 04/19 commit: add repository argument to register_commit_graftStefan Beller, May 17, 2018
  24. 07/19 commit: add repository argument to lookup_commit_graftStefan Beller, May 17, 2018
  25. 08/19 shallow: add repository argument to set_alternate_shallow_fileStefan Beller, May 17, 2018
  26. 09/19 shallow: add repository argument to register_shallowStefan Beller, May 17, 2018
  27. 10/19 shallow: add repository argument to check_shallow_file_for_updateStefan Beller, May 17, 2018
  28. 12/19 commit: convert commit_graft_pos() to handle arbitrary repositoriesStefan Beller, May 17, 2018
  29. 14/19 commit: convert read_graft_file to handle arbitrary repositoriesStefan Beller, May 17, 2018
  30. 15/19 cache: convert get_graft_file to handle arbitrary repositoriesStefan Beller, May 17, 2018
  31. 19/19 commit: allow lookup_commit_graft to handle arbitrary repositoriesStefan Beller, May 17, 2018
  32. 17/19 shallow: migrate shallow information into the object parserStefan Beller, May 17, 2018
  33. 16/19 path.c: migrate global git_path_* to take a repository argumentStefan Beller, May 17, 2018
  34. 11/19 shallow: add repository argument to is_repository_shallowStefan Beller, May 17, 2018
  35. 13/19 commit: convert register_commit_graft to handle arbitrary repositoriesStefan Beller, May 17, 2018
  36. 18/19 commit: allow prepare_commit_graft to handle arbitrary repositoriesStefan Beller, May 17, 2018
  37. 01/19 object-store: move object access functions to object-store.hStefan Beller, May 17, 2018
  38. 06/19 commit: add repository argument to prepare_commit_graftStefan Beller, May 17, 2018
  39. 05/19 commit: add repository argument to read_graft_fileStefan Beller, May 17, 2018
  40. 03/19 commit: add repository argument to commit_graft_posStefan Beller, May 17, 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.