MCPcopy Create free account
hub / github.com/git/git / read_line_from_git_path

Function read_line_from_git_path

wt-status.c:1314–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1312}
1313
1314static char *read_line_from_git_path(struct repository *r, const char *filename)
1315{
1316 struct strbuf buf = STRBUF_INIT;
1317 FILE *fp = fopen_or_warn(repo_git_path_append(r, &buf,
1318 "%s", filename), "r");
1319
1320 if (!fp) {
1321 strbuf_release(&buf);
1322 return NULL;
1323 }
1324 strbuf_getline_lf(&buf, fp);
1325 if (!fclose(fp)) {
1326 return strbuf_detach(&buf, NULL);
1327 } else {
1328 strbuf_release(&buf);
1329 return NULL;
1330 }
1331}
1332
1333static int split_commit_in_progress(struct wt_status *s)
1334{

Callers 1

split_commit_in_progressFunction · 0.85

Calls 5

fopen_or_warnFunction · 0.85
repo_git_path_appendFunction · 0.85
strbuf_releaseFunction · 0.85
strbuf_getline_lfFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected