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

[PATCH 3/4] Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2008, 10:54 UTC
Message-ID
<1204887286-32574-2-git-send-email-gitster@pobox.com>
In-Reply-To
<1204887286-32574-1-git-send-email-gitster@pobox.com>

When get_pathspec() was originally made absolute-path capable, we botched the interface to it, without dying inside the function when given a path that is outside the work tree, and made it the responsibility of callers to check the condition in a roundabout way. This is made unnecessary with the previous patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin-add.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/builtin-add.c b/builtin-add.c
index 820110e..4a91e3e 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -228,18 +228,6 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 		goto finish;
 	}
 
-	if (*argv) {
-		/* Was there an invalid path? */
-		if (pathspec) {
-			int num;
-			for (num = 0; pathspec[num]; num++)
-				; /* just counting */
-			if (argc != num)
-				exit(1); /* error message already given */
-		} else
-			exit(1); /* error message already given */
-	}
Previous: Junio C HamanoNext: Junio C Hamano
Message 2 of 3 in “Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)”
  1. 2/4 Revert part of 744dacd (builtin-mv: minimum fix to avoid losing files)Junio C Hamano, Mar 7, 2008
  2. 3/4 Revert part of 1abf095 (git-add: adjust to the get_pathspec() changes)Junio C Hamano, Mar 7, 2008
  3. 4/4 Revert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec())Junio C Hamano, Mar 7, 2008

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.