Skip to content

Commit

Permalink
Merge branch 'jk/sha1write-void'
Browse files Browse the repository at this point in the history
Code clean-up.

* jk/sha1write-void:
  do not pretend sha1write returns errors
  • Loading branch information
gitster committed Jan 10, 2014
2 parents 4ba46c2 + 9af270e commit f06a5e6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 0 additions & 2 deletions builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,6 @@ static void write_pack_file(void)
f = create_tmp_packfile(&pack_tmp_name);

offset = write_pack_header(f, nr_remaining);
if (!offset)
die_errno("unable to write pack header");
nr_written = 0;
for (; i < nr_objects; i++) {
struct object_entry *e = write_order[i];
Expand Down
3 changes: 1 addition & 2 deletions csum-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int sha1close(struct sha1file *f, unsigned char *result, unsigned int flags)
return fd;
}

int sha1write(struct sha1file *f, const void *buf, unsigned int count)
void sha1write(struct sha1file *f, const void *buf, unsigned int count)
{
while (count) {
unsigned offset = f->offset;
Expand Down Expand Up @@ -116,7 +116,6 @@ int sha1write(struct sha1file *f, const void *buf, unsigned int count)
}
f->offset = offset;
}
return 0;
}

struct sha1file *sha1fd(int fd, const char *name)
Expand Down
2 changes: 1 addition & 1 deletion csum-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern struct sha1file *sha1fd(int fd, const char *name);
extern struct sha1file *sha1fd_check(const char *name);
extern struct sha1file *sha1fd_throughput(int fd, const char *name, struct progress *tp);
extern int sha1close(struct sha1file *, unsigned char *, unsigned int);
extern int sha1write(struct sha1file *, const void *, unsigned int);
extern void sha1write(struct sha1file *, const void *, unsigned int);
extern void sha1flush(struct sha1file *f);
extern void crc32_begin(struct sha1file *);
extern uint32_t crc32_end(struct sha1file *);
Expand Down
3 changes: 1 addition & 2 deletions pack-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ off_t write_pack_header(struct sha1file *f, uint32_t nr_entries)
hdr.hdr_signature = htonl(PACK_SIGNATURE);
hdr.hdr_version = htonl(PACK_VERSION);
hdr.hdr_entries = htonl(nr_entries);
if (sha1write(f, &hdr, sizeof(hdr)))
return 0;
sha1write(f, &hdr, sizeof(hdr));
return sizeof(hdr);
}

Expand Down

0 comments on commit f06a5e6

Please sign in to comment.