summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f7391ce)
raw | patch | inline | side by side (parent: f7391ce)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 18:24:41 +0000 (11:24 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Sat, 9 Apr 2005 18:24:41 +0000 (11:24 -0700) |
It's supposed to test the returned file type, not think that read_sha1_file()
tests it. Confusion from "cat-file" command line usage.
tests it. Confusion from "cat-file" command line usage.
checkout-cache.c | patch | blob | history |
diff --git a/checkout-cache.c b/checkout-cache.c
index 1b50da8f1a8107d81a005b025df971e8a497f940..6baf4f21b2bc24c1b510ed702106ce661a8dc363 100644 (file)
--- a/checkout-cache.c
+++ b/checkout-cache.c
void *new;
unsigned long size;
long wrote;
+ char type[20];
- new = read_sha1_file(ce->sha1, "blob", &size);
- if (!new) {
+ new = read_sha1_file(ce->sha1, type, &size);
+ if (!new || strcmp(type, "blob")) {
fprintf(stderr, "checkout-cache: unable to read sha1 file of %s (%s)\n",
ce->name, sha1_to_hex(ce->sha1));
return -1;