git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] test-oidmap: remove 'add' subcommand

From
Christian Couder <christian.couder@gmail.com>
Date
Jun 29, 2019, 07:57 UTC
Message-ID
<20190629075747.32586-1-chriscool@tuxfamily.org>

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>
---
This and 2/2 follow this discussion about test coverage:
https://public-inbox.org/git/CAP8UFD3VFdCUwDBTb9en22FO7HnWc4vgQ4h0hhariCB=om4b8A@mail.gmail.com/
 t/helper/test-oidmap.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/t/helper/test-oidmap.c b/t/helper/test-oidmap.c
index 7036588175..0acf99931e 100644
--- a/t/helper/test-oidmap.c
+++ b/t/helper/test-oidmap.c
@@ -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);
-- 
2.22.0.464.g81fc6c5d4a.dirty
Next: Christian Couder
Message 1 of 2 in “test-oidmap: remove 'add' subcommand”
  1. 1/2 test-oidmap: remove 'add' subcommandChristian Couder, Jun 29, 2019
  2. 2/2 t0016: add 'remove' subcommand testChristian Couder, Jun 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.