Skip to content

Commit

Permalink
Consolidate null_sha1[].
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junio@twinsun.com>
  • Loading branch information
Junio C Hamano authored and Junio C Hamano committed Oct 1, 2005
1 parent 894a8a8 commit 88cd621
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)
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);

Expand Down
1 change: 0 additions & 1 deletion diff-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ static void show_modified(int oldmode, int mode,

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;
Expand Down
3 changes: 1 addition & 2 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "diffcore.h"

static const char *diff_opts = "-pu";
static unsigned char null_sha1[20] = { 0, };

static int use_size_cache;

Expand Down Expand Up @@ -414,7 +413,7 @@ void diff_free_filespec_data(struct diff_filespec *s)
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;
Expand Down
2 changes: 2 additions & 0 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#endif
#endif

const unsigned char null_sha1[20] = { 0, };

static unsigned int sha1_file_open_flag = O_NOATIME;

static unsigned hexval(char c)
Expand Down

0 comments on commit 88cd621

Please sign in to comment.