MCPcopy Index your code
hub / github.com/git/git / read_mailmap_file

Function read_mailmap_file

mailmap.c:143–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143int read_mailmap_file(struct string_list *map, const char *filename,
144 unsigned flags)
145{
146 char buffer[1024];
147 FILE *f;
148 int fd;
149
150 if (!filename)
151 return 0;
152
153 if (flags & MAILMAP_NOFOLLOW)
154 fd = open_nofollow(filename, O_RDONLY);
155 else
156 fd = open(filename, O_RDONLY);
157
158 if (fd < 0) {
159 if (errno == ENOENT)
160 return 0;
161 return error_errno("unable to open mailmap at %s", filename);
162 }
163 f = xfdopen(fd, "r");
164
165 while (fgets(buffer, sizeof(buffer), f) != NULL)
166 read_mailmap_line(map, buffer);
167 fclose(f);
168 return 0;
169}
170
171static void read_mailmap_string(struct string_list *map, char *buf)
172{

Callers 2

read_mailmapFunction · 0.85
cmd_check_mailmapFunction · 0.85

Calls 4

open_nofollowFunction · 0.85
error_errnoFunction · 0.85
xfdopenFunction · 0.85
read_mailmap_lineFunction · 0.85

Tested by

no test coverage detected