commit - 6b7476e9f2c7f6070401b1d58a55e87149f8151d
commit + 07a7f8ade254a4d5ce8af30faf37748391c19da0
blob - 030daff11cfa0bf0a47b46776049caf3b8ff3423
blob + 7e70195ecd3a25097bdeea05d233ea42746d78f1
--- regress/worktree/worktree_test.c
+++ regress/worktree/worktree_test.c
static int
check_meta_file_exists(const char *worktree_path, const char *name)
{
- FILE *f;
+ struct stat sb;
char *path;
if (asprintf(&path, "%s/%s/%s", worktree_path, GOT_WORKTREE_GOT_DIR,
name) == -1)
return 0;
- f = fopen(path, "r");
- free(path);
- if (f == NULL)
+ if (stat(path, &sb) == -1)
return 0;
- fclose(f);
return 1;
}