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

[PATCH 09/10] read-cache.c: make fill/match_stat_data() static

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 14, 2015, 23:40 UTC
Message-ID
<1421278855-8126-10-git-send-email-gitster@pobox.com>
In-Reply-To
<1421278855-8126-1-git-send-email-gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 cache.h      | 14 --------------
 read-cache.c | 14 ++++++++++++--
 2 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/cache.h b/cache.h
index f704af5..98911c8 100644
--- a/cache.h
+++ b/cache.h
@@ -539,20 +539,6 @@ extern int ie_modified(const struct index_state *, const struct cache_entry *, s
 extern int index_fd(unsigned char *sha1, int fd, struct stat *st, enum object_type type, const char *path, unsigned flags);
 extern int index_path(unsigned char *sha1, const char *path, struct stat *st, unsigned flags);
 
-/*
- * Record to sd the data from st that we use to check whether a file
- * might have changed.
- */
-extern void fill_stat_data(struct stat_data *sd, struct stat *st);
-
-/*
- * Return 0 if st is consistent with a file not having been changed
- * since sd was filled.  If there are differences, return a
- * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
- * INODE_CHANGED, and DATA_CHANGED.
- */
-extern int match_stat_data(const struct stat_data *sd, struct stat *st);
-
 extern void fill_stat_cache_info(struct cache_entry *ce, struct stat *st);
 
 #define REFRESH_REALLY		0x0001	/* ignore_valid */
diff --git a/read-cache.c b/read-cache.c
index 9cff715..5a71de1 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -83,7 +83,11 @@ void rename_index_entry_at(struct index_state *istate, int nr, const char *new_n
 	add_index_entry(istate, new, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);
 }
 
-void fill_stat_data(struct stat_data *sd, struct stat *st)
+/*
+ * Record to sd the data from st that we use to check whether a file
+ * might have changed.
+ */
+static void fill_stat_data(struct stat_data *sd, struct stat *st)
 {
 	sd->sd_ctime.sec = (unsigned int)st->st_ctime;
 	sd->sd_mtime.sec = (unsigned int)st->st_mtime;
@@ -96,7 +100,13 @@ void fill_stat_data(struct stat_data *sd, struct stat *st)
 	sd->sd_size = st->st_size;
 }
 
-int match_stat_data(const struct stat_data *sd, struct stat *st)
+/*
+ * Return 0 if st is consistent with a file not having been changed
+ * since sd was filled.  If there are differences, return a
+ * combination of MTIME_CHANGED, CTIME_CHANGED, OWNER_CHANGED,
+ * INODE_CHANGED, and DATA_CHANGED.
+ */
+static int match_stat_data(const struct stat_data *sd, struct stat *st)
 {
 	int changed = 0;
 
-- 
2.3.0-rc0-134-g109a908
Previous: Jeff KingNext: Junio C Hamano
Message 14 of 19 in “mark private symbols static”
  1. 00/10 mark private symbols staticJunio C Hamano, Jan 14, 2015
  2. 01/10 http.c: make finish_active_slot() and handle_curl_result() staticJunio C Hamano, Jan 14, 2015
  3. Jeff KingJan 15, 2015
  4. 02/10 line-log.c: make line_log_data_init() staticJunio C Hamano, Jan 14, 2015
  5. 03/10 prompt.c: remove git_getpass() nobody usesJunio C Hamano, Jan 14, 2015
  6. Jeff KingJan 15, 2015
  7. 04/10 revision.c: make save_parents() and free_saved_parents() staticJunio C Hamano, Jan 14, 2015
  8. 05/10 urlmatch.c: make match_urls() staticJunio C Hamano, Jan 14, 2015
  9. Jeff KingJan 15, 2015
  10. 06/10 remote.c: make clear_cas_option() staticJunio C Hamano, Jan 14, 2015
  11. 07/10 shallow.c: make check_shallow_file_for_update() staticJunio C Hamano, Jan 14, 2015
  12. 08/10 pack-bitmap.c: make pack_bitmap_filename() staticJunio C Hamano, Jan 14, 2015
  13. Jeff KingJan 15, 2015
  14. 09/10 read-cache.c: make fill/match_stat_data() staticJunio C Hamano, Jan 14, 2015
  15. 10/10 commit: show "Author:" hint when the ident is not given explicitlyJunio C Hamano, Jan 14, 2015
  16. Jeff KingJan 15, 2015
  17. Stefan BellerJan 15, 2015
  18. Jeff KingJan 15, 2015
  19. Junio C HamanoJan 15, 2015

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.