checkout-index: fix --temp relative path mangling
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 59fb70087a438a763cdbfb2c4e75de36d533aead..f0bd7ac0e94653ffed45b6e3418a60c3031a65c3 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -1520,9 +1520,8 @@ static enum peel_status peel_object(const unsigned char *name, unsigned char *sh
 
        if (o->type == OBJ_NONE) {
                int type = sha1_object_info(name, NULL);
-               if (type < 0)
+               if (type < 0 || !object_as_type(o, type, 0))
                        return PEEL_INVALID;
-               o->type = type;
        }
 
        if (o->type != OBJ_TAG)