commit c989aca485698fb1bd4093170a2913d4351d3ec2
parent 017f2b62406f3ccd4c95eeb7748dfc40224987fd
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 20 Feb 2026 20:56:20 +0900
format: clean up header includes
Diffstat:
9 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/git/commit.c b/src/git/commit.c
@@ -10,9 +10,7 @@
#include <git2/types.h>
#include <stdlib.h>
-#include "git/git.h"
#include "git/internal.h"
-#include "utils.h"
GitCommit* gitcommit_create(const git_oid* oid, git_repository* repo) {
assert(oid != NULL);
diff --git a/src/git/commit_tests.c b/src/git/commit_tests.c
@@ -1,10 +1,11 @@
+#include "git/commit.h"
+
#include <ftw.h>
#include <git2.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "git/commit.h"
#include "git/internal.h"
#include "utest.h"
diff --git a/src/git/delta_tests.c b/src/git/delta_tests.c
@@ -1,6 +1,8 @@
+#include "git/delta.h"
+
#include <stdlib.h>
#include <string.h>
-#include "git/delta.h"
+
#include "utest.h"
// Ensure graph is scaled to the maximum width when linecount exceeds max_width.
diff --git a/src/git/file.c b/src/git/file.c
@@ -5,7 +5,6 @@
#include <string.h>
#include "git/internal.h"
-#include "utils.h"
GitFile* gitfile_create(FileType type,
const char* mode,
diff --git a/src/git/git.c b/src/git/git.c
@@ -9,7 +9,6 @@
#include "git/internal.h"
#include "third_party/openbsd/reallocarray.h"
-#include "utils.h"
/* Global const data. */
static_assert(GOUT_OID_MAX_SIZE == GIT_OID_MAX_HEXSIZE + 1,
diff --git a/src/git/internal.h b/src/git/internal.h
@@ -2,10 +2,13 @@
#define GOUT_GIT_INTERNAL_H_
#include <git2.h>
+
#include "git/commit.h"
#include "git/delta.h"
#include "git/file.h"
#include "git/reference.h"
+#include "git/repo.h"
+#include "utils.h"
GitCommit* gitcommit_create(const git_oid* oid, git_repository* repo);
void gitcommit_free(GitCommit* commit);
@@ -27,8 +30,6 @@ GitReference* gitreference_create(git_repository* repo, git_reference* ref);
void gitreference_free(GitReference* ref);
int gitreference_compare(const void* r1, const void* r2);
-#include "git/repo.h"
-#include "utils.h"
void gitrepo_load_filesystem_metadata(GitRepo* repo,
const FileSystem* fs,
const char* path);
diff --git a/src/git/reference.c b/src/git/reference.c
@@ -11,7 +11,6 @@
#include <time.h>
#include "git/internal.h"
-#include "utils.h"
GitReference* gitreference_create(git_repository* repo,
git_reference* git_ref) {
diff --git a/src/git/repo.c b/src/git/repo.c
@@ -25,7 +25,6 @@
#include "git/internal.h"
#include "third_party/openbsd/reallocarray.h"
-#include "utils.h"
/* Local const data */
static const char* kLicenses[] = {"HEAD:LICENSE", "HEAD:LICENSE.md",
diff --git a/src/git/repo_tests.c b/src/git/repo_tests.c
@@ -1,4 +1,3 @@
-#include "git/internal.h"
#include "git/repo.h"
#include <stdio.h>
@@ -6,6 +5,7 @@
#include <string.h>
#include "fs_inmemory.h"
+#include "git/internal.h"
#include "utest.h"
struct git_repo {