standardize usage info string format
[gitweb.git] / builtin / cat-file.c
index 707330499fad66a0bddbb5cf96ff0569e2fe3433..c2e4e53ce454376f074259e4844ded134b30c8db 100644 (file)
@@ -82,8 +82,9 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
                                enum object_type type;
                                unsigned long size;
                                char *buffer = read_sha1_file(sha1, &type, &size);
-                               if (memcmp(buffer, "object ", 7) ||
-                                   get_sha1_hex(buffer + 7, blob_sha1))
+                               const char *target;
+                               if (!skip_prefix(buffer, "object ", &target) ||
+                                   get_sha1_hex(target, blob_sha1))
                                        die("%s not a valid tag", sha1_to_hex(sha1));
                                free(buffer);
                        } else
@@ -328,8 +329,8 @@ static int batch_objects(struct batch_options *opt)
 }
 
 static const char * const cat_file_usage[] = {
-       N_("git cat-file (-t|-s|-e|-p|<type>|--textconv) <object>"),
-       N_("git cat-file (--batch|--batch-check) < <list_of_objects>"),
+       N_("git cat-file (-t | -s | -e | -p | <type> | --textconv) <object>"),
+       N_("git cat-file (--batch | --batch-check) < <list-of-objects>"),
        NULL
 };