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

[PATCH v2 23/25] pack: move has_sha1_pack()

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Aug 9, 2017, 01:22 UTC
Message-ID
<5849701548adb4a116ecc2d5d110029a1b409cd4.1502241234.git.jonathantanmy@google.com>
In-Reply-To
<cover.1502241234.git.jonathantanmy@google.com>
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---
 builtin/prune-packed.c | 1 +
 cache.h                | 2 --
 diff.c                 | 1 +
 pack.h                 | 2 ++
 packfile.c             | 6 ++++++
 revision.c             | 1 +
 sha1_file.c            | 6 ------
 7 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index ac978ad40..79130aa2e 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -2,6 +2,7 @@
 #include "cache.h"
 #include "progress.h"
 #include "parse-options.h"
+#include "pack.h"
 
 static const char * const prune_packed_usage[] = {
 	N_("git prune-packed [-n | --dry-run] [-q | --quiet]"),
diff --git a/cache.h b/cache.h
index 06a8caae6..d96d36d50 100644
--- a/cache.h
+++ b/cache.h
@@ -1190,8 +1190,6 @@ extern int check_sha1_signature(const unsigned char *sha1, void *buf, unsigned l
 
 extern int finalize_object_file(const char *tmpfile, const char *filename);
 
-extern int has_sha1_pack(const unsigned char *sha1);
-
 /*
  * Open the loose object at path, check its sha1, and return the contents,
  * type, and size. If the object is a blob, then "contents" may return NULL,
diff --git a/diff.c b/diff.c
index 85e714f6c..6bbc46326 100644
--- a/diff.c
+++ b/diff.c
@@ -20,6 +20,7 @@
 #include "string-list.h"
 #include "argv-array.h"
 #include "graph.h"
+#include "pack.h"
 
 #ifdef NO_FAST_WORKING_DIRECTORY
 #define FAST_WORKING_DIRECTORY 0
diff --git a/pack.h b/pack.h
index 1021a781c..ce0e15deb 100644
--- a/pack.h
+++ b/pack.h
@@ -223,4 +223,6 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
 
 extern int find_pack_entry(const unsigned char *sha1, struct pack_entry *e);
 
+extern int has_sha1_pack(const unsigned char *sha1);
+
 #endif
diff --git a/packfile.c b/packfile.c
index 0f1e3338b..507f65236 100644
--- a/packfile.c
+++ b/packfile.c
@@ -1849,3 +1849,9 @@ int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
 	}
 	return 0;
 }
+
+int has_sha1_pack(const unsigned char *sha1)
+{
+	struct pack_entry e;
+	return find_pack_entry(sha1, &e);
+}
diff --git a/revision.c b/revision.c
index 6603af944..2868c4fc8 100644
--- a/revision.c
+++ b/revision.c
@@ -19,6 +19,7 @@
 #include "dir.h"
 #include "cache-tree.h"
 #include "bisect.h"
+#include "pack.h"
 
 volatile show_early_output_fn_t show_early_output;
 
diff --git a/sha1_file.c b/sha1_file.c
index 1a505eae5..2610ea057 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1629,12 +1629,6 @@ int has_pack_index(const unsigned char *sha1)
 	return 1;
 }
 
-int has_sha1_pack(const unsigned char *sha1)
-{
-	struct pack_entry e;
-	return find_pack_entry(sha1, &e);
-}
-
 int has_sha1_file_with_flags(const unsigned char *sha1, int flags)
 {
 	if (!startup_info->have_repository)
-- 
2.14.0.434.g98096fd7a8-goog
Previous: Jonathan TanNext: Jonathan Tan
Message 41 of 88 in “An attempt to move packfile funcs to its own file”
  1. 00/10 An attempt to move packfile funcs to its own fileJonathan Tan, Aug 8, 2017
  2. 01/10 pack: move pack name-related functionsJonathan Tan, Aug 8, 2017
  3. Stefan BellerAug 8, 2017
  4. Jonathan TanAug 8, 2017
  5. Christian CouderAug 9, 2017
  6. Jonathan TanAug 9, 2017
  7. Ben PeartAug 11, 2017
  8. Junio C HamanoAug 11, 2017
  9. Jonathan TanAug 16, 2017
  10. 02/10 pack: move static state variablesJonathan Tan, Aug 8, 2017
  11. 03/10 pack: move pack_report()Jonathan Tan, Aug 8, 2017
  12. 06/10 pack: move pack-closing functionsJonathan Tan, Aug 8, 2017
  13. 07/10 pack: move use_pack()Jonathan Tan, Aug 8, 2017
  14. 09/10 pack: move add_packed_git()Jonathan Tan, Aug 8, 2017
  15. 10/10 pack: move install_packed_git()Jonathan Tan, Aug 8, 2017
  16. 05/10 pack: move release_pack_memory()Jonathan Tan, Aug 8, 2017
  17. 04/10 pack: move open_pack_index(), parse_pack_index()Jonathan Tan, Aug 8, 2017
  18. Junio C HamanoAug 8, 2017
  19. Jonathan TanAug 8, 2017
  20. 08/10 pack: move unuse_pack()Jonathan Tan, Aug 8, 2017
  21. Junio C HamanoAug 8, 2017
  22. Jonathan TanAug 8, 2017
  23. Junio C HamanoAug 8, 2017
  24. 00/25 Move exported packfile funcs to its own fileJonathan Tan, Aug 9, 2017
  25. 01/25 pack: move pack name-related functionsJonathan Tan, Aug 9, 2017
  26. 02/25 pack: move static state variablesJonathan Tan, Aug 9, 2017
  27. 03/25 pack: move pack_report()Jonathan Tan, Aug 9, 2017
  28. 05/25 pack: move release_pack_memory()Jonathan Tan, Aug 9, 2017
  29. 04/25 pack: move open_pack_index(), parse_pack_index()Jonathan Tan, Aug 9, 2017
  30. 08/25 pack: move unuse_pack()Jonathan Tan, Aug 9, 2017
  31. 07/25 pack: move use_pack()Jonathan Tan, Aug 9, 2017
  32. 13/25 pack: move get_size_from_delta()Jonathan Tan, Aug 9, 2017
  33. 14/25 pack: move unpack_object_header()Jonathan Tan, Aug 9, 2017
  34. 17/25 pack: move packed_object_info(), unpack_entry()Jonathan Tan, Aug 9, 2017
  35. 15/25 sha1_file: set whence in storage-specific info fnJonathan Tan, Aug 9, 2017
  36. 18/25 pack: move nth_packed_object_{sha1,oid}Jonathan Tan, Aug 9, 2017
  37. 22/25 pack: move find_pack_entry() and make it globalJonathan Tan, Aug 9, 2017
  38. 25/25 pack: move for_each_packed_object()Jonathan Tan, Aug 9, 2017
  39. 24/25 pack: move has_pack_index()Jonathan Tan, Aug 9, 2017
  40. 16/25 sha1_file: remove read_packed_sha1()Jonathan Tan, Aug 9, 2017
  41. 23/25 pack: move has_sha1_pack()Jonathan Tan, Aug 9, 2017
  42. 21/25 pack: move find_sha1_pack()Jonathan Tan, Aug 9, 2017
  43. 20/25 pack: move find_pack_entry_one(), is_pack_valid()Jonathan Tan, Aug 9, 2017
  44. 19/25 pack: move check_pack_index_ptr(), nth_packed_object_offset()Jonathan Tan, Aug 9, 2017
  45. 10/25 pack: move install_packed_git()Jonathan Tan, Aug 9, 2017
  46. 06/25 pack: move pack-closing functionsJonathan Tan, Aug 9, 2017
  47. 09/25 pack: move add_packed_git()Jonathan Tan, Aug 9, 2017
  48. 11/25 pack: move {,re}prepare_packed_git and approximate_object_countJonathan Tan, Aug 9, 2017
  49. 12/25 pack: move unpack_object_header()Jonathan Tan, Aug 9, 2017
  50. Stefan BellerAug 10, 2017
  51. Junio C HamanoAug 10, 2017
  52. Jonathan TanAug 10, 2017
  53. Junio C HamanoAug 10, 2017
  54. 0/2 non-move patches in preparation for packfile.cJonathan Tan, Aug 11, 2017
  55. 1/2 sha1_file: set whence in storage-specific info fnJonathan Tan, Aug 11, 2017
  56. Junio C HamanoAug 11, 2017
  57. 2/2 sha1_file: remove read_packed_sha1()Jonathan Tan, Aug 11, 2017
  58. Junio C HamanoAug 11, 2017
  59. Ben PeartAug 11, 2017
  60. Jonathan TanAug 18, 2017
  61. 00/23 Move exported packfile funcs to its own fileJonathan Tan, Aug 18, 2017
  62. 01/23 pack: move pack name-related functionsJonathan Tan, Aug 18, 2017
  63. 02/23 pack: move static state variablesJonathan Tan, Aug 18, 2017
  64. 06/23 pack: move pack-closing functionsJonathan Tan, Aug 18, 2017
  65. 07/23 pack: move use_pack()Jonathan Tan, Aug 18, 2017
  66. 09/23 pack: move add_packed_git()Jonathan Tan, Aug 18, 2017
  67. 08/23 pack: move unuse_pack()Jonathan Tan, Aug 18, 2017
  68. 16/23 pack: move nth_packed_object_{sha1,oid}Jonathan Tan, Aug 18, 2017
  69. 14/23 pack: move unpack_object_header()Jonathan Tan, Aug 18, 2017
  70. 17/23 pack: move check_pack_index_ptr(), nth_packed_object_offset()Jonathan Tan, Aug 18, 2017
  71. 23/23 pack: move for_each_packed_object()Jonathan Tan, Aug 18, 2017
  72. 13/23 pack: move get_size_from_delta()Jonathan Tan, Aug 18, 2017
  73. 22/23 pack: move has_pack_index()Jonathan Tan, Aug 18, 2017
  74. 15/23 pack: move clear_delta_base_cache(), packed_object_info(), unpack_entry()Jonathan Tan, Aug 18, 2017
  75. 21/23 pack: move has_sha1_pack()Jonathan Tan, Aug 18, 2017
  76. 20/23 pack: move find_pack_entry() and make it globalJonathan Tan, Aug 18, 2017
  77. 18/23 pack: move find_pack_entry_one(), is_pack_valid()Jonathan Tan, Aug 18, 2017
  78. 19/23 pack: move find_sha1_pack()Jonathan Tan, Aug 18, 2017
  79. 03/23 pack: move pack_report()Jonathan Tan, Aug 18, 2017
  80. 05/23 pack: move release_pack_memory()Jonathan Tan, Aug 18, 2017
  81. 10/23 pack: move install_packed_git()Jonathan Tan, Aug 18, 2017
  82. 11/23 pack: move {,re}prepare_packed_git and approximate_object_countJonathan Tan, Aug 18, 2017
  83. 12/23 pack: move unpack_object_header_buffer()Jonathan Tan, Aug 18, 2017
  84. 04/23 pack: move open_pack_index(), parse_pack_index()Jonathan Tan, Aug 18, 2017
  85. Junio C HamanoAug 19, 2017
  86. Junio C HamanoAug 20, 2017
  87. Jonathan TanAug 21, 2017
  88. Junio C HamanoAug 21, 2017

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.