Subject: [PATCH v3 31/31] Rename field "raw" to "_raw" in struct pathspec

From: Nguyễn Thái Ngọc Duy <[email-masked]>
Date: Sun, 13 Jan 2013 19:35:39 +0700

This patch is essentially no-op. It helps catching new use of this
field though. This field is introduced as an intermediate step for the
pathspec conversion and will be removed eventually. At this stage no
more access sites should be introduced.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email-masked]>
---
 archive.c          | 2 +-
 builtin/add.c      | 2 +-
 builtin/checkout.c | 2 +-
 builtin/ls-tree.c  | 2 +-
 cache.h            | 2 +-
 dir.c              | 4 ++--
 setup.c            | 6 +++---
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/archive.c b/archive.c
index ef50d49..d9da58b 100644
--- a/archive.c
+++ b/archive.c
@@ -236,7 +236,7 @@ static void parse_pathspec_arg(const char **pathspec,
 	 */
 	parse_pathspec(&ar_args->pathspec, PATHSPEC_FROMTOP, 0, "", pathspec);
 	if (ar_args->pathspec.nr) {
-		pathspec = ar_args->pathspec.raw;
+		pathspec = ar_args->pathspec._raw;
 		while (*pathspec) {
 			if (!path_exists(ar_args->tree, *pathspec))
 				die("path not found: %s", *pathspec);
diff --git a/builtin/add.c b/builtin/add.c
index 9edab95..a7840c8 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -209,7 +209,7 @@ int interactive_add(int argc, const char **argv, const char *prefix, int patch)
 
 	return run_add_interactive(NULL,
 				   patch ? "--patch" : NULL,
-				   pathspec.raw);
+				   pathspec._raw);
 }
 
 static int edit_patch(int argc, const char **argv, const char *prefix)
diff --git a/builtin/checkout.c b/builtin/checkout.c
index d2fc996..1b413e2 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -253,7 +253,7 @@ static int checkout_paths(const struct checkout_opts *opts,
 
 	if (opts->patch_mode)
 		return run_add_interactive(revision, "--patch=checkout",
-					   opts->pathspec.raw);
+					   opts->pathspec._raw);
 
 	lock_file = xcalloc(1, sizeof(struct lock_file));
 
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index e03aaaf..58899a5 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -35,7 +35,7 @@ static int show_recursive(const char *base, int baselen, const char *pathname)
 	if (ls_options & LS_RECURSIVE)
 		return 1;
 
-	s = pathspec.raw;
+	s = pathspec._raw;
 	if (!s)
 		return 0;
 
diff --git a/cache.h b/cache.h
index 13cc217..c7a8d28 100644
--- a/cache.h
+++ b/cache.h
@@ -482,7 +482,7 @@ extern int ie_modified(const struct index_state *, struct cache_entry *, struct
 #define PATHSPEC_ONESTAR 1	/* the pathspec pattern sastisfies GFNM_ONESTAR */
 
 struct pathspec {
-	const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
+	const char **_raw; /* get_pathspec() result, not freed by free_pathspec() */
 	int nr;
 	unsigned int has_wildcard:1;
 	unsigned int recursive:1;
diff --git a/dir.c b/dir.c
index 2a1bcb8..efc676c 100644
--- a/dir.c
+++ b/dir.c
@@ -108,7 +108,7 @@ int fill_directory(struct dir_struct *dir, const struct pathspec *pathspec)
 	len = common_prefix_len(pathspec);
 
 	/* Read the directory and prune it */
-	read_directory(dir, pathspec->nr ? pathspec->raw[0] : "", len, pathspec);
+	read_directory(dir, pathspec->nr ? pathspec->_raw[0] : "", len, pathspec);
 	return len;
 }
 
@@ -1235,7 +1235,7 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru
 	if (has_symlink_leading_path(path, len))
 		return dir->nr;
 
-	simplify = create_simplify(pathspec ? pathspec->raw : NULL);
+	simplify = create_simplify(pathspec ? pathspec->_raw : NULL);
 	if (!len || treat_leading_path(dir, path, len, simplify))
 		read_directory_recursive(dir, path, len, 0, simplify);
 	free_simplify(simplify);
diff --git a/setup.c b/setup.c
index b6f419d..69ca047 100644
--- a/setup.c
+++ b/setup.c
@@ -332,7 +332,7 @@ void parse_pathspec(struct pathspec *pathspec,
 		raw[0] = prefix;
 		raw[1] = NULL;
 		pathspec->nr = 1;
-		pathspec->raw = raw;
+		pathspec->_raw = raw;
 		return;
 	}
 
@@ -342,7 +342,7 @@ void parse_pathspec(struct pathspec *pathspec,
 
 	pathspec->nr = n;
 	pathspec->items = item = xmalloc(sizeof(*item) * n);
-	pathspec->raw = argv;
+	pathspec->_raw = argv;
 	prefixlen = prefix ? strlen(prefix) : 0;
 
 	for (i = 0; i < n; i++) {
@@ -372,7 +372,7 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
 {
 	struct pathspec ps;
 	parse_pathspec(&ps, PATHSPEC_FROMTOP, 0, prefix, pathspec);
-	return ps.raw;
+	return ps._raw;
 }
 
 /*
-- 
1.8.0.rc2.23.g1fb49df