Merge branch 'pw/sequencer-recover-from-unlockable-index' into maint
[gitweb.git] / show-index.c
index d9e4903fed24f5916962f8d315eb680f9b4013ff..1ead41e21131fcb3facc71c8e1d96bf5b65dbe8d 100644 (file)
@@ -4,15 +4,13 @@
 static const char show_index_usage[] =
 "git show-index";
 
-int main(int argc, char **argv)
+int cmd_main(int argc, const char **argv)
 {
        int i;
        unsigned nr;
        unsigned int version;
        static unsigned int top_index[256];
 
-       git_setup_gettext();
-
        if (argc != 1)
                usage(show_index_usage);
        if (fread(top_index, 2 * 4, 1, stdin) != 1)
@@ -50,7 +48,8 @@ int main(int argc, char **argv)
                        unsigned char sha1[20];
                        uint32_t crc;
                        uint32_t off;
-               } *entries = xmalloc(nr * sizeof(entries[0]));
+               } *entries;
+               ALLOC_ARRAY(entries, nr);
                for (i = 0; i < nr; i++)
                        if (fread(entries[i].sha1, 20, 1, stdin) != 1)
                                die("unable to read sha1 %u/%u", i, nr);