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

[PATCH 7/8] pathspec: convert init_pathspec_item to take an index

From
BWBrandon Williams <bmwill@google.com>
Date
May 9, 2017, 19:18 UTC
Message-ID
<20170509191805.176266-8-bmwill@google.com>
In-Reply-To
<20170509191805.176266-1-bmwill@google.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
---
 pathspec.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/pathspec.c b/pathspec.c
index bbd71b48b..c7ed8b3fb 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -430,7 +430,9 @@ static void die_path_inside_submodule(const struct pathspec_item *item,
 /*
  * Perform the initialization of a pathspec_item based on a pathspec element.
  */
-static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
+static void init_pathspec_item(struct pathspec_item *item,
+			       const struct index_state *istate,
+			       unsigned flags,
 			       const char *prefix, int prefixlen,
 			       const char *elt)
 {
@@ -500,7 +502,7 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
 	}
 
 	if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH)
-		strip_submodule_slash(item, &the_index);
+		strip_submodule_slash(item, istate);
 
 	if (magic & PATHSPEC_LITERAL) {
 		item->nowildcard_len = item->len;
@@ -627,7 +629,8 @@ void parse_pathspec(struct pathspec *pathspec,
 	for (i = 0; i < n; i++) {
 		entry = argv[i];
 
-		init_pathspec_item(item + i, flags, prefix, prefixlen, entry);
+		init_pathspec_item(item + i, &the_index, flags,
+				   prefix, prefixlen, entry);
 
 		if (item[i].magic & PATHSPEC_EXCLUDE)
 			nr_exclude++;
@@ -653,7 +656,7 @@ void parse_pathspec(struct pathspec *pathspec,
 	 */
 	if (nr_exclude == n) {
 		int plen = (!(flags & PATHSPEC_PREFER_CWD)) ? 0 : prefixlen;
-		init_pathspec_item(item + n, 0, prefix, plen, "");
+		init_pathspec_item(item + n, &the_index, 0, prefix, plen, "");
 		pathspec->nr++;
 	}
 
-- 
2.13.0.rc2.291.g57267f2277-goog
Previous: Junio C HamanoNext: Brandon Williams
Message 9 of 29 in “convert pathspec.c to take an index parameter”
  1. 0/8 convert pathspec.c to take an index parameterBrandon Williams, May 9, 2017
  2. 2/8 submodule: add die_in_unpopulated_submodule functionBrandon Williams, May 9, 2017
  3. 3/8 pathspec: change PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flagBrandon Williams, May 9, 2017
  4. Junio C HamanoMay 10, 2017
  5. Brandon WilliamsMay 10, 2017
  6. 1/8 pathspec: provide a more descriptive die messageBrandon Williams, May 9, 2017
  7. 5/8 pathspec: convert strip_submodule_slash to take an indexBrandon Williams, May 9, 2017
  8. Junio C HamanoMay 10, 2017
  9. 7/8 pathspec: convert init_pathspec_item to take an indexBrandon Williams, May 9, 2017
  10. 6/8 pathspec: convert find_pathspecs_matching_against_index to take an indexBrandon Williams, May 9, 2017
  11. 4/8 pathspec: rename PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAPBrandon Williams, May 9, 2017
  12. Junio C HamanoMay 10, 2017
  13. 8/8 pathspec: convert parse_pathspec to take an indexBrandon Williams, May 9, 2017
  14. Junio C HamanoMay 10, 2017
  15. Brandon WilliamsMay 10, 2017
  16. Junio C HamanoMay 11, 2017
  17. Johannes SixtMay 11, 2017
  18. Junio C HamanoMay 11, 2017
  19. Brandon WilliamsMay 11, 2017
  20. Junio C HamanoMay 12, 2017
  21. 0/6 convert pathspec.c to take an index parameterBrandon Williams, May 11, 2017
  22. 2/6 submodule: add die_in_unpopulated_submodule functionBrandon Williams, May 11, 2017
  23. 4/6 ls-files: prevent prune_cache from overeagerly pruning submodulesBrandon Williams, May 11, 2017
  24. 3/6 pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flagBrandon Williams, May 11, 2017
  25. 6/6 pathspec: convert find_pathspecs_matching_against_index to take an indexBrandon Williams, May 11, 2017
  26. 5/6 pathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAPBrandon Williams, May 11, 2017
  27. 1/6 pathspec: provide a more descriptive die messageBrandon Williams, May 11, 2017
  28. Junio C HamanoMay 12, 2017
  29. Brandon WilliamsMay 12, 2017

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.