@matheusbsbs / matheus-bagliano / commits / dcf01c6e6b
Fork 0

builtin-fetch--tool: adjust to updated sha1_object_info().

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Feb 27, 2007 at 02:39 UTC dcf01c6e6b9f63d6f6239a6c6ff9f6373e4c5ff8
1 file changed +6 -4
builtin-fetch--tool.c
+6 -4
@@ -17,9 +17,9 @@ static char *get_stdin(void)
17 return data;
18 }
19
20 -static void show_new(char *type, unsigned char *sha1_new)
20 +static void show_new(enum object_type type, unsigned char *sha1_new)
21 {
22 - fprintf(stderr, " %s: %s\n", type,
22 + fprintf(stderr, " %s: %s\n", typename(type),
23 find_unique_abbrev(sha1_new, DEFAULT_ABBREV));
24 }
25
@@ -51,14 +51,16 @@ static int update_local_ref(const char *name,
51 const char *note,
52 int verbose, int force)
53 {
54 - char type[20];
54 unsigned char sha1_old[20], sha1_new[20];
55 char oldh[41], newh[41];
56 struct commit *current, *updated;
57 + enum object_type type;
58
59 if (get_sha1_hex(new_head, sha1_new))
60 die("malformed object name %s", new_head);
61 - if (sha1_object_info(sha1_new, type, NULL))
61 +
62 + type = sha1_object_info(sha1_new, NULL);
63 + if (type < 0)
64 die("object %s not found", new_head);
65
66 if (!*name) {