test-oidmap: remove 'add' subcommand
authorChristian Couder <christian.couder@gmail.com>
Sat, 29 Jun 2019 07:57:46 +0000 (09:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Jul 2019 17:26:28 +0000 (10:26 -0700)
The 'add' subcommand is useless as it is mostly identical
to the 'put' subcommand, so let's remove it.

Helped-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/helper/test-oidmap.c
index 7036588175f40fb0778c860c0cbb83d5b81bbfb8..0acf99931ee176982d61078dc0e2d882377c05fd 100644 (file)
@@ -47,21 +47,7 @@ int cmd__oidmap(int argc, const char **argv)
                if (p1)
                        p2 = strtok(NULL, DELIM);
 
-               if (!strcmp("add", cmd) && p1 && p2) {
-
-                       if (get_oid(p1, &oid)) {
-                               printf("Unknown oid: %s\n", p1);
-                               continue;
-                       }
-
-                       /* create entry with oidkey from p1, value = p2 */
-                       FLEX_ALLOC_STR(entry, name, p2);
-                       oidcpy(&entry->entry.oid, &oid);
-
-                       /* add to oidmap */
-                       oidmap_put(&map, entry);
-
-               } else if (!strcmp("put", cmd) && p1 && p2) {
+               if (!strcmp("put", cmd) && p1 && p2) {
 
                        if (get_oid(p1, &oid)) {
                                printf("Unknown oid: %s\n", p1);