Clarify fetch error for missing objects.
Otherwise there're such things like: Cannot obtain needed none 9a6e87b60dbd2305c95cecce7d9d60f849a0658d while processing commit 0000000000000000000000000000000000000000. which while looks weird. What is the none needed for? Signed-off-by: Junio C Hamano <junkio@cox.net>
Alex Riesen committed
Dec 12, 2006 at 18:34 UTC
0d7a6e4ef9e2dc458a9a56ab73638d97f4e75d87
1 file changed
+8
-7
fetch.c
+8
-7
@@ -22,14 +22,15 @@ void pull_say(const char *fmt, const char *hex)
22
fprintf(stderr, fmt, hex);
23
}
24
25
-static void report_missing(const char *what, const unsigned char *missing)
25
+static void report_missing(const struct object *obj)
26
{
27
char missing_hex[41];
28
-
29
- strcpy(missing_hex, sha1_to_hex(missing));;
30
- fprintf(stderr,
31
- "Cannot obtain needed %s %s\nwhile processing commit %s.\n",
32
- what, missing_hex, sha1_to_hex(current_commit_sha1));
28
+ strcpy(missing_hex, sha1_to_hex(obj->sha1));;
29
+ fprintf(stderr, "Cannot obtain needed %s %s\n",
30
+ obj->type ? typename(obj->type): "object", missing_hex);
31
+ if (!is_null_sha1(current_commit_sha1))
32
+ fprintf(stderr, "while processing commit %s.\n",
33
+ sha1_to_hex(current_commit_sha1));
34
}
35
36
static int process(struct object *obj);
@@ -177,7 +178,7 @@ static int loop(void)
178
*/
179
if (! (obj->flags & TO_SCAN)) {
180
if (fetch(obj->sha1)) {
180
- report_missing(typename(obj->type), obj->sha1);
181
+ report_missing(obj);
182
return -1;
183
}
184
}