diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-24 00:39:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-24 00:39:54 +0300 |
commit | 1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e (patch) | |
tree | ea4841ac780e199292b086cb8d1322f2b5bbc6be /commit-graph.c | |
parent | ea78f9ee7a595d9e85195c0802d9170fe4ce442e (diff) | |
parent | 7c898554d7a80e5d70ee8816a23dc425d2f1729c (diff) |
Merge branch 'ab/valgrind-fixes'
A bit of test framework fixes with a few fixes to issues found by
valgrind.
* ab/valgrind-fixes:
commit-graph.c: don't assume that stat() succeeds
object-file: fix a unpack_loose_header() regression in 3b6a8db3b03
log test: skip a failing mkstemp() test under valgrind
tests: using custom GIT_EXEC_PATH breaks --valgrind tests
Diffstat (limited to 'commit-graph.c')
-rw-r--r-- | commit-graph.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c index fd395e699d..7943da3848 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -2209,7 +2209,8 @@ static void mark_commit_graphs(struct write_commit_graph_context *ctx) struct stat st; struct utimbuf updated_time; - stat(ctx->commit_graph_filenames_before[i], &st); + if (stat(ctx->commit_graph_filenames_before[i], &st) < 0) + continue; updated_time.actime = st.st_atime; updated_time.modtime = now; @@ -2250,7 +2251,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) strbuf_setlen(&path, dirnamelen); strbuf_addstr(&path, de->d_name); - stat(path.buf, &st); + if (stat(path.buf, &st) < 0) + continue; if (st.st_mtime > expire_time) continue; |