aboutsummaryrefslogtreecommitdiff
path: root/builtin-fetch--tool.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-02-27 02:39:51 -0800
committerJunio C Hamano <junkio@cox.net>2007-02-27 02:39:51 -0800
commitdcf01c6e6b9f63d6f6239a6c6ff9f6373e4c5ff8 (patch)
tree5e645dbf7ad4afc0ed784b6bd6f9a740eeeaa67b /builtin-fetch--tool.c
parent88459358cdd70246e805b0ee7db7fffb9564f80e (diff)
downloadgit-dcf01c6e6b9f63d6f6239a6c6ff9f6373e4c5ff8.tar.gz
git-dcf01c6e6b9f63d6f6239a6c6ff9f6373e4c5ff8.tar.xz
builtin-fetch--tool: adjust to updated sha1_object_info().
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin-fetch--tool.c')
-rw-r--r--builtin-fetch--tool.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index 48de08d85..e9d16e631 100644
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
@@ -17,9 +17,9 @@ static char *get_stdin(void)
return data;
}
-static void show_new(char *type, unsigned char *sha1_new)
+static void show_new(enum object_type type, unsigned char *sha1_new)
{
- fprintf(stderr, " %s: %s\n", type,
+ fprintf(stderr, " %s: %s\n", typename(type),
find_unique_abbrev(sha1_new, DEFAULT_ABBREV));
}
@@ -51,14 +51,16 @@ static int update_local_ref(const char *name,
const char *note,
int verbose, int force)
{
- char type[20];
unsigned char sha1_old[20], sha1_new[20];
char oldh[41], newh[41];
struct commit *current, *updated;
+ enum object_type type;
if (get_sha1_hex(new_head, sha1_new))
die("malformed object name %s", new_head);
- if (sha1_object_info(sha1_new, type, NULL))
+
+ type = sha1_object_info(sha1_new, NULL);
+ if (type < 0)
die("object %s not found", new_head);
if (!*name) {