Skip to content

Commit

Permalink
rename field "raw" to "_raw" in struct pathspec
Browse files Browse the repository at this point in the history
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 <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Nguyễn Thái Ngọc Duy authored and Junio C Hamano committed Jul 15, 2013
1 parent 61588cc commit b3920bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion builtin/ls-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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;

Expand Down
4 changes: 2 additions & 2 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,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;
}

Expand Down Expand Up @@ -1293,7 +1293,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);
Expand Down
6 changes: 3 additions & 3 deletions pathspec.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void parse_pathspec(struct pathspec *pathspec,
raw[0] = prefix;
raw[1] = NULL;
pathspec->nr = 1;
pathspec->raw = raw;
pathspec->_raw = raw;
return;
}

Expand All @@ -297,7 +297,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++) {
Expand Down Expand Up @@ -357,7 +357,7 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP,
PATHSPEC_PREFER_CWD,
prefix, pathspec);
return ps.raw;
return ps._raw;
}

void copy_pathspec(struct pathspec *dst, const struct pathspec *src)
Expand Down
2 changes: 1 addition & 1 deletion pathspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#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;
Expand Down

0 comments on commit b3920bb

Please sign in to comment.