Commits

Anonymous committed 88cd621

Consolidate null_sha1[].

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

Comments (0)

Files changed (4)

 extern char *sha1_file_name(const unsigned char *sha1);
 extern char *sha1_pack_name(const unsigned char *sha1);
 extern char *sha1_pack_index_name(const unsigned char *sha1);
+extern const unsigned char null_sha1[20];
 
 int git_mkstemp(char *path, size_t n, const char *template);
 
 
 int main(int argc, const char **argv)
 {
-	static const unsigned char null_sha1[20] = { 0, };
 	const char **pathspec;
 	const char *prefix = setup_git_directory();
 	int entries, i;
 #include "diffcore.h"
 
 static const char *diff_opts = "-pu";
-static unsigned char null_sha1[20] = { 0, };
 
 static int use_size_cache;
 
 static void prep_temp_blob(struct diff_tempfile *temp,
 			   void *blob,
 			   unsigned long size,
-			   unsigned char *sha1,
+			   const unsigned char *sha1,
 			   int mode)
 {
 	int fd;
 #endif
 #endif
 
+const unsigned char null_sha1[20] = { 0, };
+
 static unsigned int sha1_file_open_flag = O_NOATIME;
 
 static unsigned hexval(char c)