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

[PATCH 4/5] tempfile: stop using the_repository

From
René Scharfe <l.s.r@web.de>
Date
Jul 14, 2026, 17:59 UTC
Message-ID
<20260714175956.54601-5-l.s.r@web.de>
In-Reply-To
<20260714175956.54601-1-l.s.r@web.de>

Remove the compatibility wrappers create_tempfile_mode() and create_tempfile() that have become unused.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 tempfile.c | 7 -------
 tempfile.h | 7 -------
 2 files changed, 14 deletions(-)
diff --git a/tempfile.c b/tempfile.c
index 3132eb4371..dc9ca4e645 100644
--- a/tempfile.c
+++ b/tempfile.c
@@ -42,8 +42,6 @@
  * file created by its parent.
  */
 
-#define USE_THE_REPOSITORY_VARIABLE
-
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "path.h"
@@ -134,11 +132,6 @@ static void deactivate_tempfile(struct tempfile *tempfile)
 }
 
 /* Make sure errno contains a meaningful value on error */
-struct tempfile *create_tempfile_mode(const char *path, int mode)
-{
-	return repo_create_tempfile_mode(the_repository, path, mode);
-}
-
 struct tempfile *repo_create_tempfile_mode(struct repository *r,
 					   const char *path, int mode)
 {
diff --git a/tempfile.h b/tempfile.h
index 2d17e4dad3..f571f3c609 100644
--- a/tempfile.h
+++ b/tempfile.h
@@ -94,16 +94,9 @@ struct tempfile {
  * `core.sharedRepository`, so it is not guaranteed to have the given
  * mode.
  */
-struct tempfile *create_tempfile_mode(const char *path, int mode);
-
 struct tempfile *repo_create_tempfile_mode(struct repository *r,
 					   const char *path, int mode);
 
-static inline struct tempfile *create_tempfile(const char *path)
-{
-	return create_tempfile_mode(path, 0666);
-}
-
 static inline struct tempfile *repo_create_tempfile(struct repository *r,
 						    const char *path)
 {
-- 
2.55.0
Previous: René ScharfeNext: Patrick Steinhardt
Message 7 of 15 in “tempfile: stop using the_repository”
  1. 0/5 tempfile: stop using the_repositoryRené Scharfe, Jul 14, 2026
  2. 1/5 tempfile: add repo_create_tempfile{,_mode}()René Scharfe, Jul 14, 2026
  3. Patrick SteinhardtJul 15, 2026
  4. René ScharfeJul 15, 2026
  5. 2/5 refs/packed: use repo_create_tempfile()René Scharfe, Jul 14, 2026
  6. 3/5 lockfile: add repo_hold_lock_file_for_update{,_timeout}{,_mode}()René Scharfe, Jul 14, 2026
  7. 4/5 tempfile: stop using the_repositoryRené Scharfe, Jul 14, 2026
  8. Patrick SteinhardtJul 15, 2026
  9. 5/5 use repo_hold_lock_file_for_update{,_mode,_timeout}() with custom reposRené Scharfe, Jul 14, 2026
  10. Patrick SteinhardtJul 15, 2026
  11. René ScharfeJul 18, 2026
  12. Junio C HamanoJul 19, 2026
  13. Patrick SteinhardtJul 21, 2026
  14. Junio C HamanoJul 14, 2026
  15. Patrick SteinhardtJul 15, 2026

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.