summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-23 21:39:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-05-23 21:39:54 (GMT)
commit1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e (patch)
treeea4841ac780e199292b086cb8d1322f2b5bbc6be /commit-graph.c
parentea78f9ee7a595d9e85195c0802d9170fe4ce442e (diff)
parent7c898554d7a80e5d70ee8816a23dc425d2f1729c (diff)
downloadgit-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.zip
git-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.tar.gz
git-1b8138fb0880e399dcb6fcc6b6d4081c1a1db40e.tar.bz2
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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/commit-graph.c b/commit-graph.c
index fd395e6..7943da3 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;