@matheusbsbs / matheus-bagliano / commits / 88cd621dee
Fork 0

Consolidate null_sha1[].

Signed-off-by: Junio C Hamano <junio@twinsun.com>

Junio C Hamano committed Sep 30, 2005 at 14:02 UTC 88cd621deedd2aab8f0a4c6ea3afed7269e66d0c
4 files changed +4 -3
cache.h
+1
@@ -189,6 +189,7 @@ extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)
189 extern char *sha1_file_name(const unsigned char *sha1);
190 extern char *sha1_pack_name(const unsigned char *sha1);
191 extern char *sha1_pack_index_name(const unsigned char *sha1);
192 +extern const unsigned char null_sha1[20];
193
194 int git_mkstemp(char *path, size_t n, const char *template);
195
diff-files.c
-1
@@ -34,7 +34,6 @@ static void show_modified(int oldmode, int mode,
34
35 int main(int argc, const char **argv)
36 {
37 - static const unsigned char null_sha1[20] = { 0, };
37 const char **pathspec;
38 const char *prefix = setup_git_directory();
39 int entries, i;
diff.c
+1 -2
@@ -10,7 +10,6 @@
10 #include "diffcore.h"
11
12 static const char *diff_opts = "-pu";
13 -static unsigned char null_sha1[20] = { 0, };
13
14 static int use_size_cache;
15
@@ -414,7 +413,7 @@ void diff_free_filespec_data(struct diff_filespec *s)
413 static void prep_temp_blob(struct diff_tempfile *temp,
414 void *blob,
415 unsigned long size,
417 - unsigned char *sha1,
416 + const unsigned char *sha1,
417 int mode)
418 {
419 int fd;
sha1_file.c
+2
@@ -20,6 +20,8 @@
20 #endif
21 #endif
22
23 +const unsigned char null_sha1[20] = { 0, };
24 +
25 static unsigned int sha1_file_open_flag = O_NOATIME;
26
27 static unsigned hexval(char c)