[PATCH 4/4] Revert part of d089eba (setup: sanitize absolute and funny paths in get_pathspec())

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 builtin-ls-files.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/builtin-ls-files.c b/builtin-ls-files.c
index 25dbfb4..dc7eab8 100644
--- a/builtin-ls-files.c
+++ b/builtin-ls-files.c
@@ -574,17 +574,8 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
 	pathspec = get_pathspec(prefix, argv + i);
 
 	/* Verify that the pathspec matches the prefix */
-	if (pathspec) {
-		if (argc != i) {
-			int cnt;
-			for (cnt = 0; pathspec[cnt]; cnt++)
-				;
-			if (cnt != (argc - i))
-				exit(1); /* error message already given */
-		}
+	if (pathspec)
 		prefix = verify_pathspec(prefix);
-	} else if (argc != i)
-		exit(1); /* error message already given */
 
 	/* Treat unmatching pathspec elements as errors */
 	if (pathspec && error_unmatch) {
-- 
1.5.4.3.587.g0bdd73

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux