Fix "checkout-cache.c" mis-use of read_sha1_file() interface.
It's supposed to test the returned file type, not think that read_sha1_file() tests it. Confusion from "cat-file" command line usage.maint
parent
f7391ce3bd
commit
8d3af1d532
|
|
@ -42,9 +42,10 @@ static int write_entry(struct cache_entry *ce)
|
||||||
void *new;
|
void *new;
|
||||||
unsigned long size;
|
unsigned long size;
|
||||||
long wrote;
|
long wrote;
|
||||||
|
char type[20];
|
||||||
|
|
||||||
new = read_sha1_file(ce->sha1, "blob", &size);
|
new = read_sha1_file(ce->sha1, type, &size);
|
||||||
if (!new) {
|
if (!new || strcmp(type, "blob")) {
|
||||||
fprintf(stderr, "checkout-cache: unable to read sha1 file of %s (%s)\n",
|
fprintf(stderr, "checkout-cache: unable to read sha1 file of %s (%s)\n",
|
||||||
ce->name, sha1_to_hex(ce->sha1));
|
ce->name, sha1_to_hex(ce->sha1));
|
||||||
return -1;
|
return -1;
|
||||||
Loading…
Reference in New Issue