Skip to content

Commit b3920bb

Browse files
pcloudsgitster
authored andcommitted
rename field "raw" to "_raw" in struct pathspec
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 protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61588cc commit b3920bb

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

builtin/ls-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static int show_recursive(const char *base, int baselen, const char *pathname)
3636
if (ls_options & LS_RECURSIVE)
3737
return 1;
3838

39-
s = pathspec.raw;
39+
s = pathspec._raw;
4040
if (!s)
4141
return 0;
4242

dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ int fill_directory(struct dir_struct *dir, const struct pathspec *pathspec)
152152
len = common_prefix_len(pathspec);
153153

154154
/* Read the directory and prune it */
155-
read_directory(dir, pathspec->nr ? pathspec->raw[0] : "", len, pathspec);
155+
read_directory(dir, pathspec->nr ? pathspec->_raw[0] : "", len, pathspec);
156156
return len;
157157
}
158158

@@ -1293,7 +1293,7 @@ int read_directory(struct dir_struct *dir, const char *path, int len, const stru
12931293
if (has_symlink_leading_path(path, len))
12941294
return dir->nr;
12951295

1296-
simplify = create_simplify(pathspec ? pathspec->raw : NULL);
1296+
simplify = create_simplify(pathspec ? pathspec->_raw : NULL);
12971297
if (!len || treat_leading_path(dir, path, len, simplify))
12981298
read_directory_recursive(dir, path, len, 0, simplify);
12991299
free_simplify(simplify);

pathspec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ void parse_pathspec(struct pathspec *pathspec,
287287
raw[0] = prefix;
288288
raw[1] = NULL;
289289
pathspec->nr = 1;
290-
pathspec->raw = raw;
290+
pathspec->_raw = raw;
291291
return;
292292
}
293293

@@ -297,7 +297,7 @@ void parse_pathspec(struct pathspec *pathspec,
297297

298298
pathspec->nr = n;
299299
pathspec->items = item = xmalloc(sizeof(*item) * n);
300-
pathspec->raw = argv;
300+
pathspec->_raw = argv;
301301
prefixlen = prefix ? strlen(prefix) : 0;
302302

303303
for (i = 0; i < n; i++) {
@@ -357,7 +357,7 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
357357
PATHSPEC_ALL_MAGIC & ~PATHSPEC_FROMTOP,
358358
PATHSPEC_PREFER_CWD,
359359
prefix, pathspec);
360-
return ps.raw;
360+
return ps._raw;
361361
}
362362

363363
void copy_pathspec(struct pathspec *dst, const struct pathspec *src)

pathspec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define PATHSPEC_ONESTAR 1 /* the pathspec pattern sastisfies GFNM_ONESTAR */
1212

1313
struct pathspec {
14-
const char **raw; /* get_pathspec() result, not freed by free_pathspec() */
14+
const char **_raw; /* get_pathspec() result, not freed by free_pathspec() */
1515
int nr;
1616
unsigned int has_wildcard:1;
1717
unsigned int recursive:1;

0 commit comments

Comments
 (0)