Skip to content

Commit c4e804b

Browse files
author
Junio C Hamano
committed
GIT 1.1.4
2 parents 8a263ae + 3a75f67 commit c4e804b

File tree

2 files changed

+1
-18
lines changed

2 files changed

+1
-18
lines changed

fetch-pack.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,6 @@ static void filter_refs(struct ref **refs, int nr_match, char **match)
262262
{
263263
struct ref *prev, *current, *next;
264264

265-
if (!nr_match)
266-
return;
267-
268265
for (prev = NULL, current = *refs; current; current = next) {
269266
next = current->next;
270267
if ((!memcmp(current->name, "refs/", 5) &&

sha1_file.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,12 @@ struct packed_git *packed_git;
349349
static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
350350
void **idx_map_)
351351
{
352-
SHA_CTX ctx;
353-
unsigned char sha1[20];
354352
void *idx_map;
355353
unsigned int *index;
356354
unsigned long idx_size;
357355
int nr, i;
358-
int fd;
356+
int fd = open(path, O_RDONLY);
359357
struct stat st;
360-
361-
fd = open(path, O_RDONLY);
362358
if (fd < 0)
363359
return -1;
364360
if (fstat(fd, &st)) {
@@ -396,16 +392,6 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
396392
if (idx_size != 4*256 + nr * 24 + 20 + 20)
397393
return error("wrong index file size");
398394

399-
/*
400-
* File checksum.
401-
*/
402-
SHA1_Init(&ctx);
403-
SHA1_Update(&ctx, idx_map, idx_size-20);
404-
SHA1_Final(sha1, &ctx);
405-
406-
if (memcmp(sha1, idx_map + idx_size - 20, 20))
407-
return error("index checksum mismatch");
408-
409395
return 0;
410396
}
411397

0 commit comments

Comments
 (0)