summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/annotated_commit.c2
-rw-r--r--src/annotated_commit.h2
-rw-r--r--src/apply.c3
-rw-r--r--src/apply.h2
-rw-r--r--src/attr.c3
-rw-r--r--src/attr.h2
-rw-r--r--src/attr_file.c4
-rw-r--r--src/attr_file.h2
-rw-r--r--src/attrcache.c3
-rw-r--r--src/attrcache.h2
-rw-r--r--src/blame.c1
-rw-r--r--src/blame.h3
-rw-r--r--src/blame_git.c1
-rw-r--r--src/blame_git.h2
-rw-r--r--src/blob.c4
-rw-r--r--src/blob.h2
-rw-r--r--src/branch.c3
-rw-r--r--src/branch.h2
-rw-r--r--src/buf_text.h2
-rw-r--r--src/cache.c4
-rw-r--r--src/cache.h2
-rw-r--r--src/checkout.c4
-rw-r--r--src/checkout.h2
-rw-r--r--src/cherrypick.c1
-rw-r--r--src/clone.c3
-rw-r--r--src/clone.h2
-rw-r--r--src/commit.c3
-rw-r--r--src/commit.h2
-rw-r--r--src/commit_list.c2
-rw-r--r--src/commit_list.h2
-rw-r--r--src/config.c4
-rw-r--r--src/config.h2
-rw-r--r--src/config_cache.c1
-rw-r--r--src/config_file.c3
-rw-r--r--src/config_file.h2
-rw-r--r--src/crlf.c3
-rw-r--r--src/curl_stream.c2
-rw-r--r--src/curl_stream.h2
-rw-r--r--src/delta.h1
-rw-r--r--src/describe.c4
-rw-r--r--src/diff.c5
-rw-r--r--src/diff.h2
-rw-r--r--src/diff_driver.c4
-rw-r--r--src/diff_driver.h1
-rw-r--r--src/diff_file.c5
-rw-r--r--src/diff_file.h1
-rw-r--r--src/diff_generate.c5
-rw-r--r--src/diff_generate.h2
-rw-r--r--src/diff_parse.c5
-rw-r--r--src/diff_parse.h2
-rw-r--r--src/diff_print.c2
-rw-r--r--src/diff_stats.c2
-rw-r--r--src/diff_tform.c3
-rw-r--r--src/diff_tform.h2
-rw-r--r--src/diff_xdiff.c5
-rw-r--r--src/diff_xdiff.h2
-rw-r--r--src/errors.c2
-rw-r--r--src/fetch.c4
-rw-r--r--src/fetch.h2
-rw-r--r--src/fetchhead.c4
-rw-r--r--src/fetchhead.h2
-rw-r--r--src/filebuf.c3
-rw-r--r--src/filebuf.h2
-rw-r--r--src/fileops.c3
-rw-r--r--src/fileops.h1
-rw-r--r--src/filter.c3
-rw-r--r--src/filter.h1
-rw-r--r--src/fnmatch.c4
-rw-r--r--src/global.c3
-rw-r--r--src/global.h1
-rw-r--r--src/graph.c2
-rw-r--r--src/hash.c1
-rw-r--r--src/hash.h2
-rw-r--r--src/hash/hash_generic.c4
-rw-r--r--src/hash/hash_generic.h2
-rw-r--r--src/hash/hash_win32.c4
-rw-r--r--src/hash/hash_win32.h1
-rw-r--r--src/hashsig.c3
-rw-r--r--src/ident.c2
-rw-r--r--src/idxmap.h3
-rw-r--r--src/ignore.c3
-rw-r--r--src/ignore.h2
-rw-r--r--src/index.c4
-rw-r--r--src/index.h2
-rw-r--r--src/indexer.c3
-rw-r--r--src/indexer.h2
-rw-r--r--src/iterator.c1
-rw-r--r--src/iterator.h1
-rw-r--r--src/merge.c4
-rw-r--r--src/merge.h2
-rw-r--r--src/merge_driver.c4
-rw-r--r--src/merge_driver.h2
-rw-r--r--src/merge_file.c1
-rw-r--r--src/message.h2
-rw-r--r--src/mwindow.c2
-rw-r--r--src/mwindow.h2
-rw-r--r--src/netops.c4
-rw-r--r--src/netops.h3
-rw-r--r--src/object.c4
-rw-r--r--src/object.h2
-rw-r--r--src/object_api.c5
-rw-r--r--src/odb.c4
-rw-r--r--src/odb.h2
-rw-r--r--src/odb_loose.c1
-rw-r--r--src/odb_mempack.c1
-rw-r--r--src/odb_pack.c1
-rw-r--r--src/offmap.h1
-rw-r--r--src/oid.c3
-rw-r--r--src/oid.h2
-rw-r--r--src/oidarray.c3
-rw-r--r--src/oidarray.h1
-rw-r--r--src/oidmap.h1
-rw-r--r--src/openssl_stream.c3
-rw-r--r--src/openssl_stream.h2
-rw-r--r--src/pack.c4
-rw-r--r--src/pack.h3
-rw-r--r--src/patch.c4
-rw-r--r--src/patch.h2
-rw-r--r--src/patch_generate.c5
-rw-r--r--src/patch_generate.h1
-rw-r--r--src/patch_parse.c4
-rw-r--r--src/patch_parse.h2
-rw-r--r--src/path.c3
-rw-r--r--src/path.h1
-rw-r--r--src/pathspec.c3
-rw-r--r--src/pathspec.h3
-rw-r--r--src/pool.c1
-rw-r--r--src/pool.h1
-rw-r--r--src/posix.c3
-rw-r--r--src/posix.h1
-rw-r--r--src/pqueue.c1
-rw-r--r--src/pqueue.h2
-rw-r--r--src/proxy.c3
-rw-r--r--src/proxy.h4
-rw-r--r--src/push.c4
-rw-r--r--src/push.h2
-rw-r--r--src/rebase.c1
-rw-r--r--src/refdb.c5
-rw-r--r--src/refdb.h2
-rw-r--r--src/refdb_fs.c3
-rw-r--r--src/refdb_fs.h2
-rw-r--r--src/reflog.c1
-rw-r--r--src/reflog.h1
-rw-r--r--src/refs.c1
-rw-r--r--src/refs.h1
-rw-r--r--src/refspec.c4
-rw-r--r--src/refspec.h2
-rw-r--r--src/remote.c4
-rw-r--r--src/remote.h2
-rw-r--r--src/repository.c4
-rw-r--r--src/repository.h2
-rw-r--r--src/reset.c1
-rw-r--r--src/revert.c1
-rw-r--r--src/revparse.c3
-rw-r--r--src/revwalk.c4
-rw-r--r--src/revwalk.h2
-rw-r--r--src/settings.c3
-rw-r--r--src/sha1_lookup.c4
-rw-r--r--src/sha1_lookup.h2
-rw-r--r--src/signature.c2
-rw-r--r--src/signature.h2
-rw-r--r--src/socket_stream.c4
-rw-r--r--src/socket_stream.h2
-rw-r--r--src/sortedcache.h2
-rw-r--r--src/stash.c1
-rw-r--r--src/status.c4
-rw-r--r--src/status.h2
-rw-r--r--src/stransport_stream.c2
-rw-r--r--src/stransport_stream.h2
-rw-r--r--src/submodule.c4
-rw-r--r--src/submodule.h2
-rw-r--r--src/sysdir.c2
-rw-r--r--src/sysdir.h1
-rw-r--r--src/tag.c4
-rw-r--r--src/tag.h2
-rw-r--r--src/thread-utils.c1
-rw-r--r--src/tls_stream.c3
-rw-r--r--src/tls_stream.h2
-rw-r--r--src/trace.c4
-rw-r--r--src/trace.h2
-rw-r--r--src/transaction.c3
-rw-r--r--src/transport.c2
-rw-r--r--src/transports/auth.c3
-rw-r--r--src/transports/auth.h2
-rw-r--r--src/transports/auth_negotiate.c3
-rw-r--r--src/transports/auth_negotiate.h1
-rw-r--r--src/transports/cred.c2
-rw-r--r--src/transports/cred.h2
-rw-r--r--src/transports/cred_helpers.c1
-rw-r--r--src/transports/git.c2
-rw-r--r--src/transports/http.c3
-rw-r--r--src/transports/local.c3
-rw-r--r--src/transports/smart.c4
-rw-r--r--src/transports/smart.h3
-rw-r--r--src/transports/smart_protocol.c3
-rw-r--r--src/transports/ssh.c3
-rw-r--r--src/transports/ssh.h2
-rw-r--r--src/transports/winhttp.c2
-rw-r--r--src/tree-cache.c1
-rw-r--r--src/tree-cache.h1
-rw-r--r--src/tree.c4
-rw-r--r--src/tree.h2
-rw-r--r--src/unix/map.c5
-rw-r--r--src/unix/realpath.c5
-rw-r--r--src/util.c6
-rw-r--r--src/util.h2
-rw-r--r--src/varint.c1
-rw-r--r--src/varint.h2
-rw-r--r--src/vector.c2
-rw-r--r--src/win32/dir.c3
-rw-r--r--src/win32/dir.h1
-rw-r--r--src/win32/error.c2
-rw-r--r--src/win32/error.h2
-rw-r--r--src/win32/findfile.c3
-rw-r--r--src/win32/findfile.h2
-rw-r--r--src/win32/map.c2
-rw-r--r--src/win32/path_w32.c4
-rw-r--r--src/win32/path_w32.h1
-rw-r--r--src/win32/posix_w32.c3
-rw-r--r--src/win32/precompiled.h3
-rw-r--r--src/win32/thread.c1
-rw-r--r--src/win32/thread.h2
-rw-r--r--src/win32/utf-conv.c1
-rw-r--r--src/win32/utf-conv.h3
-rw-r--r--src/win32/w32_buffer.c2
-rw-r--r--src/win32/w32_buffer.h2
-rw-r--r--src/win32/w32_crtdbg_stacktrace.c3
-rw-r--r--src/win32/w32_crtdbg_stacktrace.h2
-rw-r--r--src/win32/w32_stack.c3
-rw-r--r--src/win32/w32_stack.h2
-rw-r--r--src/win32/w32_util.h2
-rw-r--r--src/worktree.c3
-rw-r--r--src/worktree.h2
-rw-r--r--src/zstream.c3
-rw-r--r--src/zstream.h3
235 files changed, 437 insertions, 143 deletions
diff --git a/src/annotated_commit.c b/src/annotated_commit.c
index c2c770cba..72ba80a22 100644
--- a/src/annotated_commit.c
+++ b/src/annotated_commit.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "annotated_commit.h"
+
#include "refs.h"
#include "cache.h"
diff --git a/src/annotated_commit.h b/src/annotated_commit.h
index 3ac8b5f69..b390066b2 100644
--- a/src/annotated_commit.h
+++ b/src/annotated_commit.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_annotated_commit_h__
#define INCLUDE_annotated_commit_h__
+#include "common.h"
+
#include "oidarray.h"
#include "git2/oid.h"
diff --git a/src/apply.c b/src/apply.c
index 595f5f300..7801a0a54 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "apply.h"
+
#include <assert.h>
#include "git2/patch.h"
@@ -12,7 +14,6 @@
#include "array.h"
#include "patch.h"
#include "fileops.h"
-#include "apply.h"
#include "delta.h"
#include "zstream.h"
diff --git a/src/apply.h b/src/apply.h
index 96e0f55b5..b29460c0b 100644
--- a/src/apply.h
+++ b/src/apply.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_apply_h__
#define INCLUDE_apply_h__
+#include "common.h"
+
#include "git2/patch.h"
#include "buffer.h"
diff --git a/src/attr.c b/src/attr.c
index fe3ccf492..17309d0eb 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "attr.h"
+
#include "repository.h"
#include "sysdir.h"
#include "config.h"
diff --git a/src/attr.h b/src/attr.h
index f9f216d07..977565205 100644
--- a/src/attr.h
+++ b/src/attr.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_attr_h__
#define INCLUDE_attr_h__
+#include "common.h"
+
#include "attr_file.h"
#include "attrcache.h"
diff --git a/src/attr_file.c b/src/attr_file.c
index 0ac4c9cbc..55d0c3865 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "attr_file.h"
+
#include "repository.h"
#include "filebuf.h"
-#include "attr_file.h"
#include "attrcache.h"
#include "git2/blob.h"
#include "git2/tree.h"
diff --git a/src/attr_file.h b/src/attr_file.h
index a9af2403a..fedf55af5 100644
--- a/src/attr_file.h
+++ b/src/attr_file.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_attr_file_h__
#define INCLUDE_attr_file_h__
+#include "common.h"
+
#include "git2/oid.h"
#include "git2/attr.h"
#include "vector.h"
diff --git a/src/attrcache.c b/src/attrcache.c
index d516bb4db..65e7b4655 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "attrcache.h"
+
#include "repository.h"
#include "attr_file.h"
#include "config.h"
diff --git a/src/attrcache.h b/src/attrcache.h
index b91edd3e8..f528911ea 100644
--- a/src/attrcache.h
+++ b/src/attrcache.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_attrcache_h__
#define INCLUDE_attrcache_h__
+#include "common.h"
+
#include "attr_file.h"
#include "strmap.h"
diff --git a/src/blame.c b/src/blame.c
index 2c8584ba5..a923bf003 100644
--- a/src/blame.c
+++ b/src/blame.c
@@ -6,6 +6,7 @@
*/
#include "blame.h"
+
#include "git2/commit.h"
#include "git2/revparse.h"
#include "git2/revwalk.h"
diff --git a/src/blame.h b/src/blame.h
index d8db8d5c1..8fd3ee5b1 100644
--- a/src/blame.h
+++ b/src/blame.h
@@ -1,8 +1,9 @@
#ifndef INCLUDE_blame_h__
#define INCLUDE_blame_h__
-#include "git2/blame.h"
#include "common.h"
+
+#include "git2/blame.h"
#include "vector.h"
#include "diff.h"
#include "array.h"
diff --git a/src/blame_git.c b/src/blame_git.c
index 13f5cb47c..3c221b318 100644
--- a/src/blame_git.c
+++ b/src/blame_git.c
@@ -6,6 +6,7 @@
*/
#include "blame_git.h"
+
#include "commit.h"
#include "blob.h"
#include "xdiff/xinclude.h"
diff --git a/src/blame_git.h b/src/blame_git.h
index 1891b0e1f..48b85a20d 100644
--- a/src/blame_git.h
+++ b/src/blame_git.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_blame_git__
#define INCLUDE_blame_git__
+#include "common.h"
+
#include "blame.h"
int git_blame__get_origin(
diff --git a/src/blob.c b/src/blob.c
index 19d3039fb..3396fe74f 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -5,14 +5,14 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "blob.h"
+
#include "git2/common.h"
#include "git2/object.h"
#include "git2/repository.h"
#include "git2/odb_backend.h"
-#include "common.h"
#include "filebuf.h"
-#include "blob.h"
#include "filter.h"
#include "buf_text.h"
diff --git a/src/blob.h b/src/blob.h
index 4cd9f1e0c..3f1f97719 100644
--- a/src/blob.h
+++ b/src/blob.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_blob_h__
#define INCLUDE_blob_h__
+#include "common.h"
+
#include "git2/blob.h"
#include "repository.h"
#include "odb.h"
diff --git a/src/branch.c b/src/branch.c
index fe4955ad6..0697a77fb 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "branch.h"
+
#include "commit.h"
#include "tag.h"
#include "config.h"
diff --git a/src/branch.h b/src/branch.h
index d02f2af0d..5ae227c05 100644
--- a/src/branch.h
+++ b/src/branch.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_branch_h__
#define INCLUDE_branch_h__
+#include "common.h"
+
#include "buffer.h"
int git_branch_upstream__name(
diff --git a/src/buf_text.h b/src/buf_text.h
index c9c55af89..163bef1ad 100644
--- a/src/buf_text.h
+++ b/src/buf_text.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_buf_text_h__
#define INCLUDE_buf_text_h__
+#include "common.h"
+
#include "buffer.h"
typedef enum {
diff --git a/src/cache.c b/src/cache.c
index c92a3a78a..cdd12979f 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -5,12 +5,12 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "cache.h"
+
#include "repository.h"
#include "commit.h"
#include "thread-utils.h"
#include "util.h"
-#include "cache.h"
#include "odb.h"
#include "object.h"
#include "git2/oid.h"
diff --git a/src/cache.h b/src/cache.h
index 0f0bfcf5d..9c09954ae 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_cache_h__
#define INCLUDE_cache_h__
+#include "common.h"
+
#include "git2/common.h"
#include "git2/oid.h"
#include "git2/odb.h"
diff --git a/src/checkout.c b/src/checkout.c
index 25018d291..6c7a94441 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include <assert.h>
-
#include "checkout.h"
+#include <assert.h>
+
#include "git2/repository.h"
#include "git2/refs.h"
#include "git2/tree.h"
diff --git a/src/checkout.h b/src/checkout.h
index 60aa29b26..517fbf3b1 100644
--- a/src/checkout.h
+++ b/src/checkout.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_checkout_h__
#define INCLUDE_checkout_h__
+#include "common.h"
+
#include "git2/checkout.h"
#include "iterator.h"
diff --git a/src/cherrypick.c b/src/cherrypick.c
index d8b6858ae..e42b74815 100644
--- a/src/cherrypick.c
+++ b/src/cherrypick.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "repository.h"
#include "filebuf.h"
#include "merge.h"
diff --git a/src/clone.c b/src/clone.c
index 16ddface2..8764bb728 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "clone.h"
+
#include <assert.h>
#include "git2/clone.h"
@@ -16,7 +18,6 @@
#include "git2/commit.h"
#include "git2/tree.h"
-#include "common.h"
#include "remote.h"
#include "fileops.h"
#include "refs.h"
diff --git a/src/clone.h b/src/clone.h
index fa2049817..864b59029 100644
--- a/src/clone.h
+++ b/src/clone.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_clone_h__
#define INCLUDE_clone_h__
+#include "common.h"
+
#include "git2/clone.h"
extern int git_clone__should_clone_local(const char *url, git_clone_local_t local);
diff --git a/src/commit.c b/src/commit.c
index 4a340058a..838688bb8 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -5,13 +5,14 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "commit.h"
+
#include "git2/common.h"
#include "git2/object.h"
#include "git2/repository.h"
#include "git2/signature.h"
#include "git2/sys/commit.h"
-#include "common.h"
#include "odb.h"
#include "commit.h"
#include "signature.h"
diff --git a/src/commit.h b/src/commit.h
index d01ac2b2f..781809d70 100644
--- a/src/commit.h
+++ b/src/commit.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_commit_h__
#define INCLUDE_commit_h__
+#include "common.h"
+
#include "git2/commit.h"
#include "tree.h"
#include "repository.h"
diff --git a/src/commit_list.c b/src/commit_list.c
index 3bba58c27..96bd9dc15 100644
--- a/src/commit_list.c
+++ b/src/commit_list.c
@@ -6,7 +6,7 @@
*/
#include "commit_list.h"
-#include "common.h"
+
#include "revwalk.h"
#include "pool.h"
#include "odb.h"
diff --git a/src/commit_list.h b/src/commit_list.h
index 9746c2801..a7551a2bc 100644
--- a/src/commit_list.h
+++ b/src/commit_list.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_commit_list_h__
#define INCLUDE_commit_list_h__
+#include "common.h"
+
#include "git2/oid.h"
#define PARENT1 (1 << 0)
diff --git a/src/config.c b/src/config.c
index 169a62880..602e0e827 100644
--- a/src/config.c
+++ b/src/config.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "sysdir.h"
#include "config.h"
+
+#include "sysdir.h"
#include "git2/config.h"
#include "git2/sys/config.h"
#include "vector.h"
diff --git a/src/config.h b/src/config.h
index 00c12b50d..a5fcf2e84 100644
--- a/src/config.h
+++ b/src/config.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_config_h__
#define INCLUDE_config_h__
+#include "common.h"
+
#include "git2.h"
#include "git2/config.h"
#include "vector.h"
diff --git a/src/config_cache.c b/src/config_cache.c
index 840722274..0efb1a789 100644
--- a/src/config_cache.c
+++ b/src/config_cache.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "fileops.h"
#include "repository.h"
#include "config.h"
diff --git a/src/config_file.c b/src/config_file.c
index e15d57bbb..e6eeab4cb 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "config_file.h"
+
#include "config.h"
#include "filebuf.h"
#include "sysdir.h"
diff --git a/src/config_file.h b/src/config_file.h
index 654e6cacf..11b8118f5 100644
--- a/src/config_file.h
+++ b/src/config_file.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_config_file_h__
#define INCLUDE_config_file_h__
+#include "common.h"
+
#include "git2/sys/config.h"
#include "git2/config.h"
diff --git a/src/crlf.c b/src/crlf.c
index b8ae5cda1..9af60076d 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -5,12 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include "git2/attr.h"
#include "git2/blob.h"
#include "git2/index.h"
#include "git2/sys/filter.h"
-#include "common.h"
#include "fileops.h"
#include "hash.h"
#include "filter.h"
diff --git a/src/curl_stream.c b/src/curl_stream.c
index 4e0455cca..24bf62635 100644
--- a/src/curl_stream.c
+++ b/src/curl_stream.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "curl_stream.h"
+
#ifdef GIT_CURL
#include <curl/curl.h>
diff --git a/src/curl_stream.h b/src/curl_stream.h
index 283f0fe40..debade7e2 100644
--- a/src/curl_stream.h
+++ b/src/curl_stream.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_curl_stream_h__
#define INCLUDE_curl_stream_h__
+#include "common.h"
+
#include "git2/sys/stream.h"
extern int git_curl_stream_new(git_stream **out, const char *host, const char *port);
diff --git a/src/delta.h b/src/delta.h
index cc9372922..f61987304 100644
--- a/src/delta.h
+++ b/src/delta.h
@@ -6,6 +6,7 @@
#define INCLUDE_git_delta_h__
#include "common.h"
+
#include "pack.h"
typedef struct git_delta_index git_delta_index;
diff --git a/src/describe.c b/src/describe.c
index 4a1e25378..edf8edfd1 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -4,12 +4,14 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#include "git2/describe.h"
#include "git2/strarray.h"
#include "git2/diff.h"
#include "git2/status.h"
-#include "common.h"
#include "commit.h"
#include "commit_list.h"
#include "oidmap.h"
diff --git a/src/diff.c b/src/diff.c
index a93bd4cd0..1c16e9c8e 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -4,9 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "git2/version.h"
-#include "common.h"
+
#include "diff.h"
+
+#include "git2/version.h"
#include "diff_generate.h"
#include "patch.h"
#include "commit.h"
diff --git a/src/diff.h b/src/diff.h
index 5750d2a09..4e5dd93da 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_h__
#define INCLUDE_diff_h__
+#include "common.h"
+
#include "git2/diff.h"
#include "git2/patch.h"
#include "git2/sys/diff.h"
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 9109f3155..8cd57cdf6 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -4,12 +4,12 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
+#include "diff_driver.h"
#include "git2/attr.h"
#include "diff.h"
-#include "diff_driver.h"
#include "strmap.h"
#include "map.h"
#include "buf_text.h"
diff --git a/src/diff_driver.h b/src/diff_driver.h
index 0706dcfc5..5691cac30 100644
--- a/src/diff_driver.h
+++ b/src/diff_driver.h
@@ -8,6 +8,7 @@
#define INCLUDE_diff_driver_h__
#include "common.h"
+
#include "buffer.h"
typedef struct git_diff_driver_registry git_diff_driver_registry;
diff --git a/src/diff_file.c b/src/diff_file.c
index d5fc5e940..270d59bbb 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -4,12 +4,13 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
+#include "diff_file.h"
+
#include "git2/blob.h"
#include "git2/submodule.h"
#include "diff.h"
#include "diff_generate.h"
-#include "diff_file.h"
#include "odb.h"
#include "fileops.h"
#include "filter.h"
diff --git a/src/diff_file.h b/src/diff_file.h
index 0d54b6d33..5da7a7bb8 100644
--- a/src/diff_file.h
+++ b/src/diff_file.h
@@ -8,6 +8,7 @@
#define INCLUDE_diff_file_h__
#include "common.h"
+
#include "diff.h"
#include "diff_driver.h"
#include "map.h"
diff --git a/src/diff_generate.c b/src/diff_generate.c
index f6cc04fed..6436ab930 100644
--- a/src/diff_generate.c
+++ b/src/diff_generate.c
@@ -4,9 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "diff.h"
+
#include "diff_generate.h"
+
+#include "diff.h"
#include "patch_generate.h"
#include "fileops.h"
#include "config.h"
diff --git a/src/diff_generate.h b/src/diff_generate.h
index 8b974becf..8de2a0644 100644
--- a/src/diff_generate.h
+++ b/src/diff_generate.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_generate_h__
#define INCLUDE_diff_generate_h__
+#include "common.h"
+
#include "diff.h"
#include "pool.h"
#include "index.h"
diff --git a/src/diff_parse.c b/src/diff_parse.c
index 5e3a7a177..78da3b675 100644
--- a/src/diff_parse.c
+++ b/src/diff_parse.c
@@ -4,9 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "diff.h"
+
#include "diff_parse.h"
+
+#include "diff.h"
#include "patch.h"
#include "patch_parse.h"
diff --git a/src/diff_parse.h b/src/diff_parse.h
index c47d4cbc9..876782128 100644
--- a/src/diff_parse.h
+++ b/src/diff_parse.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_parse_h__
#define INCLUDE_diff_parse_h__
+#include "common.h"
+
#include "diff.h"
typedef struct {
diff --git a/src/diff_print.c b/src/diff_print.c
index 5aa8a37e6..28ae38424 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -4,7 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
+
#include "diff.h"
#include "diff_file.h"
#include "patch_generate.h"
diff --git a/src/diff_stats.c b/src/diff_stats.c
index 2005712cd..583c68459 100644
--- a/src/diff_stats.c
+++ b/src/diff_stats.c
@@ -4,7 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
+
#include "vector.h"
#include "diff.h"
#include "patch_generate.h"
diff --git a/src/diff_tform.c b/src/diff_tform.c
index b004ddd66..c0461a3a3 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -4,7 +4,8 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
+#include "diff_tform.h"
#include "git2/config.h"
#include "git2/blob.h"
diff --git a/src/diff_tform.h b/src/diff_tform.h
index dbb4b5455..a31c40f8e 100644
--- a/src/diff_tform.h
+++ b/src/diff_tform.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_tform_h__
#define INCLUDE_diff_tform_h__
+#include "common.h"
+
#include "diff_file.h"
extern int git_diff_find_similar__hashsig_for_file(
diff --git a/src/diff_xdiff.c b/src/diff_xdiff.c
index 60c4d85cb..5e10db13d 100644
--- a/src/diff_xdiff.c
+++ b/src/diff_xdiff.c
@@ -4,11 +4,12 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "diff_xdiff.h"
+
#include "git2/errors.h"
-#include "common.h"
#include "diff.h"
#include "diff_driver.h"
-#include "diff_xdiff.h"
#include "patch_generate.h"
static int git_xdiff_scan_int(const char **str, int *value)
diff --git a/src/diff_xdiff.h b/src/diff_xdiff.h
index 88375986b..aca80b131 100644
--- a/src/diff_xdiff.h
+++ b/src/diff_xdiff.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_diff_xdiff_h__
#define INCLUDE_diff_xdiff_h__
+#include "common.h"
+
#include "diff.h"
#include "xdiff/xdiff.h"
#include "patch_generate.h"
diff --git a/src/errors.c b/src/errors.c
index 91acc3541..a874163b0 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -4,7 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
+
#include "global.h"
#include "posix.h"
#include "buffer.h"
diff --git a/src/fetch.c b/src/fetch.c
index f408a5174..0b22b3673 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -5,16 +5,16 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "fetch.h"
+
#include "git2/oid.h"
#include "git2/refs.h"
#include "git2/revwalk.h"
#include "git2/transport.h"
-#include "common.h"
#include "remote.h"
#include "refspec.h"
#include "pack.h"
-#include "fetch.h"
#include "netops.h"
#include "repository.h"
#include "refs.h"
diff --git a/src/fetch.h b/src/fetch.h
index 4cdbf3b95..1c75af9c3 100644
--- a/src/fetch.h
+++ b/src/fetch.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_fetch_h__
#define INCLUDE_fetch_h__
+#include "common.h"
+
#include "git2/remote.h"
#include "netops.h"
diff --git a/src/fetchhead.c b/src/fetchhead.c
index 6e6f3eb5e..ac25723d3 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -5,11 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "fetchhead.h"
+
#include "git2/types.h"
#include "git2/oid.h"
-#include "fetchhead.h"
-#include "common.h"
#include "buffer.h"
#include "fileops.h"
#include "filebuf.h"
diff --git a/src/fetchhead.h b/src/fetchhead.h
index 69a1e86b5..9e5171010 100644
--- a/src/fetchhead.h
+++ b/src/fetchhead.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_fetchhead_h__
#define INCLUDE_fetchhead_h__
+#include "common.h"
+
#include "oid.h"
#include "vector.h"
diff --git a/src/filebuf.c b/src/filebuf.c
index 80250ccdf..8b7e489da 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -4,8 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
#include "filebuf.h"
+
#include "fileops.h"
static const size_t WRITE_BUFFER_SIZE = (4096 * 2);
diff --git a/src/filebuf.h b/src/filebuf.h
index c65aea780..f51ff230f 100644
--- a/src/filebuf.h
+++ b/src/filebuf.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_filebuf_h__
#define INCLUDE_filebuf_h__
+#include "common.h"
+
#include "fileops.h"
#include "hash.h"
#include <zlib.h>
diff --git a/src/fileops.c b/src/fileops.c
index 2f3f58d4f..ad3f67e2b 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -4,8 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
#include "fileops.h"
+
#include "global.h"
#include "strmap.h"
#include <ctype.h>
diff --git a/src/fileops.h b/src/fileops.h
index 46886b0d7..fd5441243 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -8,6 +8,7 @@
#define INCLUDE_fileops_h__
#include "common.h"
+
#include "map.h"
#include "posix.h"
#include "path.h"
diff --git a/src/filter.c b/src/filter.c
index 361e08529..6ab09790b 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -5,10 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "filter.h"
+
#include "common.h"
#include "fileops.h"
#include "hash.h"
-#include "filter.h"
#include "repository.h"
#include "global.h"
#include "git2/sys/filter.h"
diff --git a/src/filter.h b/src/filter.h
index 9bd835f94..b1c403ba9 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -8,6 +8,7 @@
#define INCLUDE_filter_h__
#include "common.h"
+
#include "attr_file.h"
#include "git2/filter.h"
diff --git a/src/fnmatch.c b/src/fnmatch.c
index 33c8a2512..3cc2a27ba 100644
--- a/src/fnmatch.c
+++ b/src/fnmatch.c
@@ -44,12 +44,12 @@
* Compares a filename or pathname to a pattern.
*/
+#include "fnmatch.h"
+
#include <ctype.h>
#include <stdio.h>
#include <string.h>
-#include "fnmatch.h"
-
#define EOS '\0'
#define RANGE_MATCH 1
diff --git a/src/global.c b/src/global.c
index afa57e1d6..c6847a4d2 100644
--- a/src/global.c
+++ b/src/global.c
@@ -4,8 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
#include "global.h"
+
#include "hash.h"
#include "sysdir.h"
#include "filter.h"
diff --git a/src/global.h b/src/global.h
index 88f40aad1..b75ad6f56 100644
--- a/src/global.h
+++ b/src/global.h
@@ -8,6 +8,7 @@
#define INCLUDE_global_h__
#include "common.h"
+
#include "mwindow.h"
#include "hash.h"
diff --git a/src/graph.c b/src/graph.c
index 948f7d306..df82f0f71 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include "revwalk.h"
#include "merge.h"
#include "git2/graph.h"
diff --git a/src/hash.c b/src/hash.c
index f3645a913..cc6676d4d 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -5,7 +5,6 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "hash.h"
int git_hash_buf(git_oid *out, const void *data, size_t len)
diff --git a/src/hash.h b/src/hash.h
index 0db0339dc..cce3a7f30 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_hash_h__
#define INCLUDE_hash_h__
+#include "common.h"
+
#include "git2/oid.h"
typedef struct git_hash_prov git_hash_prov;
diff --git a/src/hash/hash_generic.c b/src/hash/hash_generic.c
index 472a7a696..7b33b6194 100644
--- a/src/hash/hash_generic.c
+++ b/src/hash/hash_generic.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "hash_generic.h"
+
#include "hash.h"
-#include "hash/hash_generic.h"
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
diff --git a/src/hash/hash_generic.h b/src/hash/hash_generic.h
index daeb1cda8..114b60781 100644
--- a/src/hash/hash_generic.h
+++ b/src/hash/hash_generic.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_hash_generic_h__
#define INCLUDE_hash_generic_h__
+#include "common.h"
+
#include "hash.h"
struct git_hash_ctx {
diff --git a/src/hash/hash_win32.c b/src/hash/hash_win32.c
index 6bae53e55..4d53a57bd 100644
--- a/src/hash/hash_win32.c
+++ b/src/hash/hash_win32.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "hash_win32.h"
+
#include "global.h"
#include "hash.h"
-#include "hash/hash_win32.h"
#include <wincrypt.h>
#include <strsafe.h>
diff --git a/src/hash/hash_win32.h b/src/hash/hash_win32.h
index 2eee5ca79..187c07267 100644
--- a/src/hash/hash_win32.h
+++ b/src/hash/hash_win32.h
@@ -9,6 +9,7 @@
#define INCLUDE_hash_win32_h__
#include "common.h"
+
#include "hash.h"
#include <wincrypt.h>
diff --git a/src/hashsig.c b/src/hashsig.c
index bea538349..30d059463 100644
--- a/src/hashsig.c
+++ b/src/hashsig.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#include "git2/sys/hashsig.h"
#include "fileops.h"
#include "util.h"
diff --git a/src/ident.c b/src/ident.c
index 4718ed664..7eccf9a43 100644
--- a/src/ident.c
+++ b/src/ident.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include "git2/sys/filter.h"
#include "filter.h"
#include "buffer.h"
diff --git a/src/idxmap.h b/src/idxmap.h
index dc702c36e..f7e903a61 100644
--- a/src/idxmap.h
+++ b/src/idxmap.h
@@ -7,8 +7,9 @@
#ifndef INCLUDE_idxmap_h__
#define INCLUDE_idxmap_h__
-#include <ctype.h>
#include "common.h"
+
+#include <ctype.h>
#include "git2/index.h"
#define kmalloc git__malloc
diff --git a/src/ignore.c b/src/ignore.c
index 6496dd1f7..4c0d26dfd 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "ignore.h"
+
#include "git2/ignore.h"
#include "common.h"
-#include "ignore.h"
#include "attrcache.h"
#include "path.h"
#include "config.h"
diff --git a/src/ignore.h b/src/ignore.h
index 876c8e0ea..5895d3faa 100644
--- a/src/ignore.h
+++ b/src/ignore.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_ignore_h__
#define INCLUDE_ignore_h__
+#include "common.h"
+
#include "repository.h"
#include "vector.h"
#include "attr_file.h"
diff --git a/src/index.c b/src/index.c
index c29e90fb0..b7602fb44 100644
--- a/src/index.c
+++ b/src/index.c
@@ -5,11 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "index.h"
+
#include <stddef.h>
-#include "common.h"
#include "repository.h"
-#include "index.h"
#include "tree.h"
#include "tree-cache.h"
#include "hash.h"
diff --git a/src/index.h b/src/index.h
index 9918f140d..0f1c0956c 100644
--- a/src/index.h
+++ b/src/index.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_index_h__
#define INCLUDE_index_h__
+#include "common.h"
+
#include "fileops.h"
#include "filebuf.h"
#include "vector.h"
diff --git a/src/indexer.c b/src/indexer.c
index 15f6cc2c4..766bbc3c3 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -5,10 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "indexer.h"
+
#include "git2/indexer.h"
#include "git2/object.h"
-#include "common.h"
#include "pack.h"
#include "mwindow.h"
#include "posix.h"
diff --git a/src/indexer.h b/src/indexer.h
index cae314064..8ee6115a6 100644
--- a/src/indexer.h
+++ b/src/indexer.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_indexer_h__
#define INCLUDE_indexer_h__
+#include "common.h"
+
#include "git2/indexer.h"
extern void git_indexer__set_fsync(git_indexer *idx, int do_fsync);
diff --git a/src/iterator.c b/src/iterator.c
index 8fc62c01c..960031233 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -6,6 +6,7 @@
*/
#include "iterator.h"
+
#include "tree.h"
#include "index.h"
diff --git a/src/iterator.h b/src/iterator.h
index 0b239a5bd..0bcb128d9 100644
--- a/src/iterator.h
+++ b/src/iterator.h
@@ -8,6 +8,7 @@
#define INCLUDE_iterator_h__
#include "common.h"
+
#include "git2/index.h"
#include "vector.h"
#include "buffer.h"
diff --git a/src/merge.c b/src/merge.c
index e6fa7dca7..72cfa464d 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -5,13 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "merge.h"
+
#include "posix.h"
#include "buffer.h"
#include "repository.h"
#include "revwalk.h"
#include "commit_list.h"
-#include "merge.h"
#include "path.h"
#include "refs.h"
#include "object.h"
diff --git a/src/merge.h b/src/merge.h
index f8cac161f..173a1b435 100644
--- a/src/merge.h
+++ b/src/merge.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_merge_h__
#define INCLUDE_merge_h__
+#include "common.h"
+
#include "vector.h"
#include "commit_list.h"
#include "pool.h"
diff --git a/src/merge_driver.c b/src/merge_driver.c
index 0f35d23c2..ea4bd2787 100644
--- a/src/merge_driver.c
+++ b/src/merge_driver.c
@@ -5,11 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "merge_driver.h"
+
#include "vector.h"
#include "global.h"
#include "merge.h"
-#include "merge_driver.h"
#include "git2/merge.h"
#include "git2/sys/merge.h"
diff --git a/src/merge_driver.h b/src/merge_driver.h
index bde27502c..6b7da5287 100644
--- a/src/merge_driver.h
+++ b/src/merge_driver.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_merge_driver_h__
#define INCLUDE_merge_driver_h__
+#include "common.h"
+
#include "git2/merge.h"
#include "git2/index.h"
#include "git2/sys/merge.h"
diff --git a/src/merge_file.c b/src/merge_file.c
index 5ecd8f4d0..a54d6bd57 100644
--- a/src/merge_file.c
+++ b/src/merge_file.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "repository.h"
#include "posix.h"
#include "fileops.h"
diff --git a/src/message.h b/src/message.h
index 3c4b8dc45..88fc7884c 100644
--- a/src/message.h
+++ b/src/message.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_message_h__
#define INCLUDE_message_h__
+#include "common.h"
+
#include "git2/message.h"
#include "buffer.h"
diff --git a/src/mwindow.c b/src/mwindow.c
index 7bb9dbbe2..38d0352b4 100644
--- a/src/mwindow.c
+++ b/src/mwindow.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "mwindow.h"
+
#include "vector.h"
#include "fileops.h"
#include "map.h"
diff --git a/src/mwindow.h b/src/mwindow.h
index bdde9e0a4..ea962d1b6 100644
--- a/src/mwindow.h
+++ b/src/mwindow.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_mwindow__
#define INCLUDE_mwindow__
+#include "common.h"
+
#include "map.h"
#include "vector.h"
diff --git a/src/netops.c b/src/netops.c
index 4b73baa0e..68f404d2c 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -5,11 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "netops.h"
+
#include <ctype.h>
#include "git2/errors.h"
-#include "common.h"
-#include "netops.h"
#include "posix.h"
#include "buffer.h"
#include "http_parser.h"
diff --git a/src/netops.h b/src/netops.h
index b7170a0f2..75fd9a512 100644
--- a/src/netops.h
+++ b/src/netops.h
@@ -7,8 +7,9 @@
#ifndef INCLUDE_netops_h__
#define INCLUDE_netops_h__
-#include "posix.h"
#include "common.h"
+
+#include "posix.h"
#include "stream.h"
#ifdef GIT_OPENSSL
diff --git a/src/object.c b/src/object.c
index 2da36a2ee..4d069a34c 100644
--- a/src/object.c
+++ b/src/object.c
@@ -4,9 +4,11 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "object.h"
+
#include "git2/object.h"
-#include "common.h"
#include "repository.h"
#include "commit.h"
diff --git a/src/object.h b/src/object.h
index dd227d16d..ff61c1d33 100644
--- a/src/object.h
+++ b/src/object.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_object_h__
#define INCLUDE_object_h__
+#include "common.h"
+
#include "repository.h"
extern bool git_object__strict_input_validation;
diff --git a/src/object_api.c b/src/object_api.c
index e0d8760e7..75efa4d10 100644
--- a/src/object_api.c
+++ b/src/object_api.c
@@ -4,11 +4,12 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "git2/object.h"
#include "common.h"
-#include "repository.h"
+#include "git2/object.h"
+
+#include "repository.h"
#include "commit.h"
#include "tree.h"
#include "blob.h"
diff --git a/src/odb.c b/src/odb.c
index ae8f247e3..7da391bff 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -5,13 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "odb.h"
+
#include <zlib.h>
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
#include "fileops.h"
#include "hash.h"
-#include "odb.h"
#include "delta.h"
#include "filter.h"
#include "repository.h"
diff --git a/src/odb.h b/src/odb.h
index 61d687abf..6845b22f1 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_odb_h__
#define INCLUDE_odb_h__
+#include "common.h"
+
#include "git2/odb.h"
#include "git2/oid.h"
#include "git2/types.h"
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 99fdcb44f..72b47f091 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include <zlib.h>
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
diff --git a/src/odb_mempack.c b/src/odb_mempack.c
index d6f2fb4af..0c05f0566 100644
--- a/src/odb_mempack.c
+++ b/src/odb_mempack.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "git2/object.h"
#include "git2/sys/odb_backend.h"
#include "fileops.h"
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 51770a88e..20aff5386 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include <zlib.h>
#include "git2/repository.h"
#include "git2/indexer.h"
diff --git a/src/offmap.h b/src/offmap.h
index f9d2483a6..0b0896b8f 100644
--- a/src/offmap.h
+++ b/src/offmap.h
@@ -8,6 +8,7 @@
#define INCLUDE_offmap_h__
#include "common.h"
+
#include "git2/types.h"
#define kmalloc git__malloc
diff --git a/src/oid.c b/src/oid.c
index 9dc719194..0c63abb2e 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "oid.h"
+
#include "git2/oid.h"
#include "repository.h"
#include "global.h"
diff --git a/src/oid.h b/src/oid.h
index 922a2a347..70a92771d 100644
--- a/src/oid.h
+++ b/src/oid.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_oid_h__
#define INCLUDE_oid_h__
+#include "common.h"
+
#include "git2/oid.h"
/**
diff --git a/src/oidarray.c b/src/oidarray.c
index 1d51a2958..fda3b638d 100644
--- a/src/oidarray.c
+++ b/src/oidarray.c
@@ -5,8 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "git2/oidarray.h"
#include "oidarray.h"
+
+#include "git2/oidarray.h"
#include "array.h"
void git_oidarray_free(git_oidarray *arr)
diff --git a/src/oidarray.h b/src/oidarray.h
index a7215ae6c..f051a0ec4 100644
--- a/src/oidarray.h
+++ b/src/oidarray.h
@@ -8,6 +8,7 @@
#define INCLUDE_oidarray_h__
#include "common.h"
+
#include "git2/oidarray.h"
#include "array.h"
diff --git a/src/oidmap.h b/src/oidmap.h
index 563222494..49f129e93 100644
--- a/src/oidmap.h
+++ b/src/oidmap.h
@@ -8,6 +8,7 @@
#define INCLUDE_oidmap_h__
#include "common.h"
+
#include "git2/oid.h"
#define kmalloc git__malloc
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index 759c5015f..3860c4f3c 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "openssl_stream.h"
+
#ifdef GIT_OPENSSL
#include <ctype.h>
@@ -13,7 +15,6 @@
#include "posix.h"
#include "stream.h"
#include "socket_stream.h"
-#include "openssl_stream.h"
#include "netops.h"
#include "git2/transport.h"
#include "git2/sys/openssl.h"
diff --git a/src/openssl_stream.h b/src/openssl_stream.h
index f5e59dab1..2dcfcc929 100644
--- a/src/openssl_stream.h
+++ b/src/openssl_stream.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_openssl_stream_h__
#define INCLUDE_openssl_stream_h__
+#include "common.h"
+
#include "git2/sys/stream.h"
extern int git_openssl_stream_global_init(void);
diff --git a/src/pack.c b/src/pack.c
index f8d0dc9ac..8f3c8ab72 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "odb.h"
#include "pack.h"
+
+#include "odb.h"
#include "delta.h"
#include "sha1_lookup.h"
#include "mwindow.h"
diff --git a/src/pack.h b/src/pack.h
index e2bf165f4..c0ca74f14 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -8,11 +8,12 @@
#ifndef INCLUDE_pack_h__
#define INCLUDE_pack_h__
+#include "common.h"
+
#include <zlib.h>
#include "git2/oid.h"
-#include "common.h"
#include "map.h"
#include "mwindow.h"
#include "odb.h"
diff --git a/src/patch.c b/src/patch.c
index 519cbb872..5e329518d 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "git2/patch.h"
-#include "diff.h"
#include "patch.h"
+#include "git2/patch.h"
+#include "diff.h"
int git_patch__invoke_callbacks(
git_patch *patch,
diff --git a/src/patch.h b/src/patch.h
index 525ae7007..156d1310e 100644
--- a/src/patch.h
+++ b/src/patch.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_patch_h__
#define INCLUDE_patch_h__
+#include "common.h"
+
#include "git2/patch.h"
#include "array.h"
diff --git a/src/patch_generate.c b/src/patch_generate.c
index 804fc0e09..9363033ad 100644
--- a/src/patch_generate.c
+++ b/src/patch_generate.c
@@ -4,13 +4,14 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
+#include "patch_generate.h"
+
#include "git2/blob.h"
#include "diff.h"
#include "diff_generate.h"
#include "diff_file.h"
#include "diff_driver.h"
-#include "patch_generate.h"
#include "diff_xdiff.h"
#include "delta.h"
#include "zstream.h"
diff --git a/src/patch_generate.h b/src/patch_generate.h
index 2e89b5c4d..20f78cbfa 100644
--- a/src/patch_generate.h
+++ b/src/patch_generate.h
@@ -8,6 +8,7 @@
#define INCLUDE_patch_generate_h__
#include "common.h"
+
#include "diff.h"
#include "diff_file.h"
#include "patch.h"
diff --git a/src/patch_parse.c b/src/patch_parse.c
index 0a9edcd18..a531eec4d 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -4,9 +4,11 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "patch_parse.h"
+
#include "git2/patch.h"
#include "patch.h"
-#include "patch_parse.h"
#include "diff_parse.h"
#include "path.h"
diff --git a/src/patch_parse.h b/src/patch_parse.h
index 5c4d04fd5..f27651e39 100644
--- a/src/patch_parse.h
+++ b/src/patch_parse.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_patch_parse_h__
#define INCLUDE_patch_parse_h__
+#include "common.h"
+
#include "patch.h"
typedef struct {
diff --git a/src/path.c b/src/path.c
index 5fc7a055b..ea0a3c3f6 100644
--- a/src/path.c
+++ b/src/path.c
@@ -4,8 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
#include "path.h"
+
#include "posix.h"
#include "repository.h"
#ifdef GIT_WIN32
diff --git a/src/path.h b/src/path.h
index fb45a6534..360372cfb 100644
--- a/src/path.h
+++ b/src/path.h
@@ -8,6 +8,7 @@
#define INCLUDE_path_h__
#include "common.h"
+
#include "posix.h"
#include "buffer.h"
#include "vector.h"
diff --git a/src/pathspec.c b/src/pathspec.c
index 00dba4f6b..998b6fb36 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "pathspec.h"
+
#include "git2/pathspec.h"
#include "git2/diff.h"
-#include "pathspec.h"
#include "buf_text.h"
#include "attr_file.h"
#include "iterator.h"
diff --git a/src/pathspec.h b/src/pathspec.h
index 40cd21c3f..c4d1a83d3 100644
--- a/src/pathspec.h
+++ b/src/pathspec.h
@@ -8,7 +8,8 @@
#define INCLUDE_pathspec_h__
#include "common.h"
-#include <git2/pathspec.h>
+
+#include "git2/pathspec.h"
#include "buffer.h"
#include "vector.h"
#include "pool.h"
diff --git a/src/pool.c b/src/pool.c
index 57ce46e3c..c0efe9c9d 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -6,6 +6,7 @@
*/
#include "pool.h"
+
#include "posix.h"
#ifndef GIT_WIN32
#include <unistd.h>
diff --git a/src/pool.h b/src/pool.h
index f61f16944..92ddf994a 100644
--- a/src/pool.h
+++ b/src/pool.h
@@ -8,6 +8,7 @@
#define INCLUDE_pool_h__
#include "common.h"
+
#include "vector.h"
typedef struct git_pool_page git_pool_page;
diff --git a/src/posix.c b/src/posix.c
index fd9188ac7..6e7985ece 100644
--- a/src/posix.c
+++ b/src/posix.c
@@ -4,8 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+
#include "posix.h"
+
#include "path.h"
#include <stdio.h>
#include <ctype.h>
diff --git a/src/posix.h b/src/posix.h
index d26371bca..3e3bcb287 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -8,6 +8,7 @@
#define INCLUDE_posix_h__
#include "common.h"
+
#include <fcntl.h>
#include <time.h>
#include "fnmatch.h"
diff --git a/src/pqueue.c b/src/pqueue.c
index 9341d1af3..3820e999c 100644
--- a/src/pqueue.c
+++ b/src/pqueue.c
@@ -6,6 +6,7 @@
*/
#include "pqueue.h"
+
#include "util.h"
#define PQUEUE_LCHILD_OF(I) (((I)<<1)+1)
diff --git a/src/pqueue.h b/src/pqueue.h
index 76b14919e..c0a6cd49e 100644
--- a/src/pqueue.h
+++ b/src/pqueue.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_pqueue_h__
#define INCLUDE_pqueue_h__
+#include "common.h"
+
#include "vector.h"
typedef git_vector git_pqueue;
diff --git a/src/proxy.c b/src/proxy.c
index f53ac1151..b07371d48 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "proxy.h"
+
#include "git2/proxy.h"
int git_proxy_init_options(git_proxy_options *opts, unsigned int version)
diff --git a/src/proxy.h b/src/proxy.h
index bf9382737..7582301c9 100644
--- a/src/proxy.h
+++ b/src/proxy.h
@@ -7,8 +7,10 @@
#ifndef INCLUDE_proxy_h__
#define INCLUDE_proxy_h__
+#include "common.h"
+
#include "git2/proxy.h"
extern int git_proxy_options_dup(git_proxy_options *tgt, const git_proxy_options *src);
-#endif \ No newline at end of file
+#endif
diff --git a/src/push.c b/src/push.c
index 09c234034..c2abbb91f 100644
--- a/src/push.c
+++ b/src/push.c
@@ -5,14 +5,14 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "push.h"
+
#include "git2.h"
-#include "common.h"
#include "pack.h"
#include "pack-objects.h"
#include "remote.h"
#include "vector.h"
-#include "push.h"
#include "tree.h"
static int push_spec_rref_cmp(const void *a, const void *b)
diff --git a/src/push.h b/src/push.h
index e32ad2f4d..31ac43609 100644
--- a/src/push.h
+++ b/src/push.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_push_h__
#define INCLUDE_push_h__
+#include "common.h"
+
#include "git2.h"
#include "refspec.h"
diff --git a/src/rebase.c b/src/rebase.c
index f528031b3..3be751254 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "buffer.h"
#include "repository.h"
#include "posix.h"
diff --git a/src/refdb.c b/src/refdb.c
index 1ee0efb31..c162a153f 100644
--- a/src/refdb.c
+++ b/src/refdb.c
@@ -5,8 +5,7 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "posix.h"
+#include "refdb.h"
#include "git2/object.h"
#include "git2/refs.h"
@@ -14,9 +13,9 @@
#include "git2/sys/refdb_backend.h"
#include "hash.h"
-#include "refdb.h"
#include "refs.h"
#include "reflog.h"
+#include "posix.h"
int git_refdb_new(git_refdb **out, git_repository *repo)
{
diff --git a/src/refdb.h b/src/refdb.h
index 4ee3b8065..2d4ec753a 100644
--- a/src/refdb.h
+++ b/src/refdb.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_refdb_h__
#define INCLUDE_refdb_h__
+#include "common.h"
+
#include "git2/refdb.h"
#include "repository.h"
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index eb135dc01..ade734c6a 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "refdb_fs.h"
+
#include "refs.h"
#include "hash.h"
#include "repository.h"
@@ -13,7 +15,6 @@
#include "pack.h"
#include "reflog.h"
#include "refdb.h"
-#include "refdb_fs.h"
#include "iterator.h"
#include "sortedcache.h"
#include "signature.h"
diff --git a/src/refdb_fs.h b/src/refdb_fs.h
index a979383cf..0c84814df 100644
--- a/src/refdb_fs.h
+++ b/src/refdb_fs.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_refdb_fs_h__
#define INCLUDE_refdb_fs_h__
+#include "common.h"
+
#include "strmap.h"
typedef struct {
diff --git a/src/reflog.c b/src/reflog.c
index 98ef1b669..938999218 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -6,6 +6,7 @@
*/
#include "reflog.h"
+
#include "repository.h"
#include "filebuf.h"
#include "signature.h"
diff --git a/src/reflog.h b/src/reflog.h
index 2d31ae47d..d54b4cde8 100644
--- a/src/reflog.h
+++ b/src/reflog.h
@@ -8,6 +8,7 @@
#define INCLUDE_reflog_h__
#include "common.h"
+
#include "git2/reflog.h"
#include "vector.h"
diff --git a/src/refs.c b/src/refs.c
index f7120d9ee..942054001 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -6,6 +6,7 @@
*/
#include "refs.h"
+
#include "hash.h"
#include "repository.h"
#include "fileops.h"
diff --git a/src/refs.h b/src/refs.h
index 0c90db3af..7a1a9aed1 100644
--- a/src/refs.h
+++ b/src/refs.h
@@ -8,6 +8,7 @@
#define INCLUDE_refs_h__
#include "common.h"
+
#include "git2/oid.h"
#include "git2/refs.h"
#include "git2/refdb.h"
diff --git a/src/refspec.c b/src/refspec.c
index d200e5609..01a77c97f 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "refspec.h"
+
#include "git2/errors.h"
-#include "common.h"
-#include "refspec.h"
#include "util.h"
#include "posix.h"
#include "refs.h"
diff --git a/src/refspec.h b/src/refspec.h
index 9a87c97a5..fd2d8b312 100644
--- a/src/refspec.h
+++ b/src/refspec.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_refspec_h__
#define INCLUDE_refspec_h__
+#include "common.h"
+
#include "git2/refspec.h"
#include "buffer.h"
#include "vector.h"
diff --git a/src/remote.c b/src/remote.c
index bd8b3cfbc..8998c6083 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -5,15 +5,15 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "remote.h"
+
#include "git2/config.h"
#include "git2/types.h"
#include "git2/oid.h"
#include "git2/net.h"
-#include "common.h"
#include "config.h"
#include "repository.h"
-#include "remote.h"
#include "fetch.h"
#include "refs.h"
#include "refspec.h"
diff --git a/src/remote.h b/src/remote.h
index e696997f4..a94481f25 100644
--- a/src/remote.h
+++ b/src/remote.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_remote_h__
#define INCLUDE_remote_h__
+#include "common.h"
+
#include "git2/remote.h"
#include "git2/transport.h"
#include "git2/sys/transport.h"
diff --git a/src/repository.c b/src/repository.c
index 71f77bab9..fe549e6e8 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "repository.h"
+
#include <ctype.h>
#include "git2/object.h"
@@ -11,7 +14,6 @@
#include "git2/sys/repository.h"
#include "common.h"
-#include "repository.h"
#include "commit.h"
#include "tag.h"
#include "blob.h"
diff --git a/src/repository.h b/src/repository.h
index 52f9ec260..fd6400cc1 100644
--- a/src/repository.h
+++ b/src/repository.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_repository_h__
#define INCLUDE_repository_h__
+#include "common.h"
+
#include "git2/common.h"
#include "git2/oid.h"
#include "git2/odb.h"
diff --git a/src/reset.c b/src/reset.c
index 066b5dbda..dfecb6606 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "commit.h"
#include "tag.h"
#include "merge.h"
diff --git a/src/revert.c b/src/revert.c
index 747938fb3..54f6d48e4 100644
--- a/src/revert.c
+++ b/src/revert.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "repository.h"
#include "filebuf.h"
#include "merge.h"
diff --git a/src/revparse.c b/src/revparse.c
index fd6bd1ea6..4ab4fb96d 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include <assert.h>
-#include "common.h"
#include "buffer.h"
#include "tree.h"
#include "refdb.h"
diff --git a/src/revwalk.c b/src/revwalk.c
index 77fa9fd0c..b1aa8f91a 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -5,12 +5,12 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "revwalk.h"
+
#include "commit.h"
#include "odb.h"
#include "pool.h"
-#include "revwalk.h"
#include "git2/revparse.h"
#include "merge.h"
#include "vector.h"
diff --git a/src/revwalk.h b/src/revwalk.h
index 6b363d40f..578328b72 100644
--- a/src/revwalk.h
+++ b/src/revwalk.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_revwalk_h__
#define INCLUDE_revwalk_h__
+#include "common.h"
+
#include "git2/revwalk.h"
#include "oidmap.h"
#include "commit_list.h"
diff --git a/src/settings.c b/src/settings.c
index 52b861ba0..ba2f6a4db 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -5,12 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#ifdef GIT_OPENSSL
# include <openssl/err.h>
#endif
#include <git2.h>
-#include "common.h"
#include "sysdir.h"
#include "cache.h"
#include "global.h"
diff --git a/src/sha1_lookup.c b/src/sha1_lookup.c
index ead26de06..5081bbfb4 100644
--- a/src/sha1_lookup.c
+++ b/src/sha1_lookup.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "sha1_lookup.h"
+
#include <stdio.h>
-#include "sha1_lookup.h"
-#include "common.h"
#include "oid.h"
/*
diff --git a/src/sha1_lookup.h b/src/sha1_lookup.h
index 3799620c7..4d9056f06 100644
--- a/src/sha1_lookup.h
+++ b/src/sha1_lookup.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_sha1_lookup_h__
#define INCLUDE_sha1_lookup_h__
+#include "common.h"
+
#include <stdlib.h>
int sha1_entry_pos(const void *table,
diff --git a/src/signature.c b/src/signature.c
index a56b8a299..430fde31f 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "signature.h"
+
#include "repository.h"
#include "git2/common.h"
#include "posix.h"
diff --git a/src/signature.h b/src/signature.h
index 75265df52..40d7c54f9 100644
--- a/src/signature.h
+++ b/src/signature.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_signature_h__
#define INCLUDE_signature_h__
+#include "common.h"
+
#include "git2/common.h"
#include "git2/signature.h"
#include "repository.h"
diff --git a/src/socket_stream.c b/src/socket_stream.c
index c0a168448..4c795e462 100644
--- a/src/socket_stream.c
+++ b/src/socket_stream.c
@@ -5,11 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "socket_stream.h"
+
#include "posix.h"
#include "netops.h"
#include "stream.h"
-#include "socket_stream.h"
#ifndef _WIN32
# include <sys/types.h>
diff --git a/src/socket_stream.h b/src/socket_stream.h
index 8e9949fcd..1f9ff78d1 100644
--- a/src/socket_stream.h
+++ b/src/socket_stream.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_socket_stream_h__
#define INCLUDE_socket_stream_h__
+#include "common.h"
+
#include "netops.h"
typedef struct {
diff --git a/src/sortedcache.h b/src/sortedcache.h
index 4cacad62b..a53ff48a3 100644
--- a/src/sortedcache.h
+++ b/src/sortedcache.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_sorted_cache_h__
#define INCLUDE_sorted_cache_h__
+#include "common.h"
+
#include "util.h"
#include "fileops.h"
#include "vector.h"
diff --git a/src/stash.c b/src/stash.c
index d13220cdd..8a8c57a83 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "repository.h"
#include "commit.h"
#include "message.h"
diff --git a/src/status.c b/src/status.c
index 6752b5625..03682bc72 100644
--- a/src/status.c
+++ b/src/status.c
@@ -5,13 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "status.h"
+
#include "git2.h"
#include "fileops.h"
#include "hash.h"
#include "vector.h"
#include "tree.h"
-#include "status.h"
#include "git2/status.h"
#include "repository.h"
#include "ignore.h"
diff --git a/src/status.h b/src/status.h
index 33008b89c..907479a22 100644
--- a/src/status.h
+++ b/src/status.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_status_h__
#define INCLUDE_status_h__
+#include "common.h"
+
#include "diff.h"
#include "git2/status.h"
#include "git2/diff.h"
diff --git a/src/stransport_stream.c b/src/stransport_stream.c
index 50ed9452c..18371ef92 100644
--- a/src/stransport_stream.c
+++ b/src/stransport_stream.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "stransport_stream.h"
+
#ifdef GIT_SECURE_TRANSPORT
#include <CoreFoundation/CoreFoundation.h>
diff --git a/src/stransport_stream.h b/src/stransport_stream.h
index 714f90273..f5bbfd952 100644
--- a/src/stransport_stream.h
+++ b/src/stransport_stream.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_stransport_stream_h__
#define INCLUDE_stransport_stream_h__
+#include "common.h"
+
#include "git2/sys/stream.h"
extern int git_stransport_stream_new(git_stream **out, const char *host, const char *port);
diff --git a/src/submodule.c b/src/submodule.c
index ddd4b0663..0b97a59f6 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "submodule.h"
+
#include "git2/config.h"
#include "git2/sys/config.h"
#include "git2/types.h"
@@ -17,7 +18,6 @@
#include "config_file.h"
#include "config.h"
#include "repository.h"
-#include "submodule.h"
#include "tree.h"
#include "iterator.h"
#include "path.h"
diff --git a/src/submodule.h b/src/submodule.h
index 456a93979..72867a322 100644
--- a/src/submodule.h
+++ b/src/submodule.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_submodule_h__
#define INCLUDE_submodule_h__
+#include "common.h"
+
#include "git2/submodule.h"
#include "git2/repository.h"
#include "fileops.h"
diff --git a/src/sysdir.c b/src/sysdir.c
index 9312a7edb..7480e82fd 100644
--- a/src/sysdir.c
+++ b/src/sysdir.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "sysdir.h"
+
#include "global.h"
#include "buffer.h"
#include "path.h"
diff --git a/src/sysdir.h b/src/sysdir.h
index 79f23818a..8f4466b46 100644
--- a/src/sysdir.h
+++ b/src/sysdir.h
@@ -8,6 +8,7 @@
#define INCLUDE_sysdir_h__
#include "common.h"
+
#include "posix.h"
#include "buffer.h"
diff --git a/src/tag.c b/src/tag.c
index 2bf23fc3c..445c3ff1d 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "commit.h"
#include "tag.h"
+
+#include "commit.h"
#include "signature.h"
#include "message.h"
#include "git2/object.h"
diff --git a/src/tag.h b/src/tag.h
index d0cd393c7..8aae37840 100644
--- a/src/tag.h
+++ b/src/tag.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_tag_h__
#define INCLUDE_tag_h__
+#include "common.h"
+
#include "git2/tag.h"
#include "repository.h"
#include "odb.h"
diff --git a/src/thread-utils.c b/src/thread-utils.c
index dc9b2f09e..e5ec6a843 100644
--- a/src/thread-utils.c
+++ b/src/thread-utils.c
@@ -4,6 +4,7 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
#include "thread-utils.h"
diff --git a/src/tls_stream.c b/src/tls_stream.c
index 83e2d064a..fefb92f26 100644
--- a/src/tls_stream.c
+++ b/src/tls_stream.c
@@ -5,8 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "tls_stream.h"
+
#include "git2/errors.h"
-#include "common.h"
#include "openssl_stream.h"
#include "stransport_stream.h"
diff --git a/src/tls_stream.h b/src/tls_stream.h
index 98a704174..8971f7efc 100644
--- a/src/tls_stream.h
+++ b/src/tls_stream.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_tls_stream_h__
#define INCLUDE_tls_stream_h__
+#include "common.h"
+
#include "git2/sys/stream.h"
/**
diff --git a/src/trace.c b/src/trace.c
index 0f2142861..080d1e891 100644
--- a/src/trace.c
+++ b/src/trace.c
@@ -5,10 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "trace.h"
+
#include "buffer.h"
-#include "common.h"
#include "global.h"
-#include "trace.h"
#include "git2/trace.h"
#ifdef GIT_TRACE
diff --git a/src/trace.h b/src/trace.h
index 486084d01..498944035 100644
--- a/src/trace.h
+++ b/src/trace.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_trace_h__
#define INCLUDE_trace_h__
+#include "common.h"
+
#include <git2/trace.h>
#include "buffer.h"
diff --git a/src/transaction.c b/src/transaction.c
index 3d3f35a03..675023afd 100644
--- a/src/transaction.c
+++ b/src/transaction.c
@@ -5,7 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "transaction.h"
+
#include "repository.h"
#include "strmap.h"
#include "refdb.h"
diff --git a/src/transport.c b/src/transport.c
index b66165332..f1e18b323 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -4,7 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
+
#include "git2/types.h"
#include "git2/remote.h"
#include "git2/net.h"
diff --git a/src/transports/auth.c b/src/transports/auth.c
index c1154db34..9597cc249 100644
--- a/src/transports/auth.c
+++ b/src/transports/auth.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "auth.h"
+
#include "git2.h"
#include "buffer.h"
-#include "auth.h"
static int basic_next_token(
git_buf *out, git_http_auth_context *ctx, git_cred *c)
diff --git a/src/transports/auth.h b/src/transports/auth.h
index 52138cf8f..06af79dec 100644
--- a/src/transports/auth.h
+++ b/src/transports/auth.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_http_auth_h__
#define INCLUDE_http_auth_h__
+#include "common.h"
+
#include "git2.h"
#include "netops.h"
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index 7c868c9fd..c9bc3043d 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -5,10 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "auth_negotiate.h"
+
#ifdef GIT_GSSAPI
#include "git2.h"
-#include "common.h"
#include "buffer.h"
#include "auth.h"
diff --git a/src/transports/auth_negotiate.h b/src/transports/auth_negotiate.h
index d7270b7ab..5866c19c3 100644
--- a/src/transports/auth_negotiate.h
+++ b/src/transports/auth_negotiate.h
@@ -8,6 +8,7 @@
#ifndef INCLUDE_auth_negotiate_h__
#define INCLUDE_auth_negotiate_h__
+#include "common.h"
#include "git2.h"
#include "auth.h"
diff --git a/src/transports/cred.c b/src/transports/cred.c
index 8e3f64435..8055e2d65 100644
--- a/src/transports/cred.c
+++ b/src/transports/cred.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "cred.h"
+
#include "git2.h"
#include "smart.h"
#include "git2/cred_helpers.h"
diff --git a/src/transports/cred.h b/src/transports/cred.h
index 2de8deee8..dceab9aa3 100644
--- a/src/transports/cred.h
+++ b/src/transports/cred.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_git_cred_h__
#define INCLUDE_git_cred_h__
+#include "common.h"
+
#include "git2/transport.h"
const char *git_cred__username(git_cred *cred);
diff --git a/src/transports/cred_helpers.c b/src/transports/cred_helpers.c
index 5cc9b0869..fdc56b17e 100644
--- a/src/transports/cred_helpers.c
+++ b/src/transports/cred_helpers.c
@@ -6,6 +6,7 @@
*/
#include "common.h"
+
#include "git2/cred_helpers.h"
int git_cred_userpass(
diff --git a/src/transports/git.c b/src/transports/git.c
index 01edfdc49..e019878b5 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include "git2.h"
#include "buffer.h"
#include "netops.h"
diff --git a/src/transports/http.c b/src/transports/http.c
index cb4a6d0d5..332e6280b 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#ifndef GIT_WINHTTP
#include "git2.h"
diff --git a/src/transports/local.c b/src/transports/local.c
index e24e99860..733ed2c20 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -4,7 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
#include "common.h"
+
#include "git2/types.h"
#include "git2/net.h"
#include "git2/repository.h"
@@ -16,6 +18,7 @@
#include "git2/pack.h"
#include "git2/commit.h"
#include "git2/revparse.h"
+
#include "pack-objects.h"
#include "refs.h"
#include "posix.h"
diff --git a/src/transports/smart.c b/src/transports/smart.c
index a96fdf6fb..6d5d95fbf 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -4,8 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "git2.h"
+
#include "smart.h"
+
+#include "git2.h"
#include "refs.h"
#include "refspec.h"
#include "proxy.h"
diff --git a/src/transports/smart.h b/src/transports/smart.h
index b47001fe0..f1ad70479 100644
--- a/src/transports/smart.h
+++ b/src/transports/smart.h
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#include "git2.h"
#include "vector.h"
#include "netops.h"
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 8146fa163..d51238f12 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#include "git2.h"
#include "git2/odb_backend.h"
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 4c55e3f2a..47d328c41 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "ssh.h"
+
#ifdef GIT_SSH
#include <libssh2.h>
#endif
@@ -16,7 +18,6 @@
#include "smart.h"
#include "cred.h"
#include "socket_stream.h"
-#include "ssh.h"
#ifdef GIT_SSH
diff --git a/src/transports/ssh.h b/src/transports/ssh.h
index 2db2cc5df..e36e7246e 100644
--- a/src/transports/ssh.h
+++ b/src/transports/ssh.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_ssh_h__
#define INCLUDE_ssh_h__
+#include "common.h"
+
int git_transport_ssh_global_init(void);
#endif
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index fb504c912..6689c8ce3 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#ifdef GIT_WINHTTP
#include "git2.h"
diff --git a/src/tree-cache.c b/src/tree-cache.c
index 548054136..b331d22a2 100644
--- a/src/tree-cache.c
+++ b/src/tree-cache.c
@@ -6,6 +6,7 @@
*/
#include "tree-cache.h"
+
#include "pool.h"
#include "tree.h"
diff --git a/src/tree-cache.h b/src/tree-cache.h
index c44ca7cf5..e02300e6e 100644
--- a/src/tree-cache.h
+++ b/src/tree-cache.h
@@ -9,6 +9,7 @@
#define INCLUDE_tree_cache_h__
#include "common.h"
+
#include "pool.h"
#include "buffer.h"
#include "git2/oid.h"
diff --git a/src/tree.c b/src/tree.c
index 6b1d1b238..fcee7f3b3 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "commit.h"
#include "tree.h"
+
+#include "commit.h"
#include "git2/repository.h"
#include "git2/object.h"
#include "fileops.h"
diff --git a/src/tree.h b/src/tree.h
index 5e7a66e04..00f4b06eb 100644
--- a/src/tree.h
+++ b/src/tree.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_tree_h__
#define INCLUDE_tree_h__
+#include "common.h"
+
#include "git2/tree.h"
#include "repository.h"
#include "odb.h"
diff --git a/src/unix/map.c b/src/unix/map.c
index 9d9b1fe38..8a07fcff9 100644
--- a/src/unix/map.c
+++ b/src/unix/map.c
@@ -4,7 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include <git2/common.h>
+
+#include "common.h"
+
+#include "git2/common.h"
#if !defined(GIT_WIN32) && !defined(NO_MMAP)
diff --git a/src/unix/realpath.c b/src/unix/realpath.c
index 2e49150c2..893bac87b 100644
--- a/src/unix/realpath.c
+++ b/src/unix/realpath.c
@@ -4,7 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include <git2/common.h>
+
+#include "common.h"
+
+#include "git2/common.h"
#ifndef GIT_WIN32
diff --git a/src/util.c b/src/util.c
index a44f4c9ac..6ae5cdaec 100644
--- a/src/util.c
+++ b/src/util.c
@@ -4,8 +4,10 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include <git2.h>
-#include "common.h"
+
+#include "util.h"
+
+#include "git2.h"
#include <stdio.h>
#include <ctype.h>
#include "posix.h"
diff --git a/src/util.h b/src/util.h
index 8bba368ba..b85e03b6d 100644
--- a/src/util.h
+++ b/src/util.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_util_h__
#define INCLUDE_util_h__
+#include "common.h"
+
#include "git2/buffer.h"
#include "buffer.h"
#include "thread-utils.h"
diff --git a/src/varint.c b/src/varint.c
index beac8c709..9ffc1d744 100644
--- a/src/varint.c
+++ b/src/varint.c
@@ -5,7 +5,6 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "varint.h"
uintmax_t git_decode_varint(const unsigned char *bufp, size_t *varint_len)
diff --git a/src/varint.h b/src/varint.h
index 650ec7d2a..652e22486 100644
--- a/src/varint.h
+++ b/src/varint.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_varint_h__
#define INCLUDE_varint_h__
+#include "common.h"
+
#include <stdint.h>
extern int git_encode_varint(unsigned char *, size_t, uintmax_t);
diff --git a/src/vector.c b/src/vector.c
index 620a1f56c..b12fa942d 100644
--- a/src/vector.c
+++ b/src/vector.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "vector.h"
+
#include "integer.h"
/* In elements, not bytes */
diff --git a/src/win32/dir.c b/src/win32/dir.c
index 8a724a4e9..1d37874e4 100644
--- a/src/win32/dir.c
+++ b/src/win32/dir.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "dir.h"
+
#define GIT__WIN32_NO_WRAP_DIR
#include "posix.h"
diff --git a/src/win32/dir.h b/src/win32/dir.h
index bef39d774..704a9a8a9 100644
--- a/src/win32/dir.h
+++ b/src/win32/dir.h
@@ -8,6 +8,7 @@
#define INCLUDE_dir_h__
#include "common.h"
+
#include "w32_util.h"
struct git__dirent {
diff --git a/src/win32/error.c b/src/win32/error.c
index 6b450093f..3a52fb5a9 100644
--- a/src/win32/error.c
+++ b/src/win32/error.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "error.h"
+
#include "utf-conv.h"
#ifdef GIT_WINHTTP
diff --git a/src/win32/error.h b/src/win32/error.h
index 12947a2e6..a2ecf6a6a 100644
--- a/src/win32/error.h
+++ b/src/win32/error.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_git_win32_error_h__
#define INCLUDE_git_win32_error_h__
+#include "common.h"
+
extern char *git_win32_get_error_message(DWORD error_code);
#endif
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index 1c768f7f4..d56aa1fd2 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -5,10 +5,11 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "findfile.h"
+
#include "path_w32.h"
#include "utf-conv.h"
#include "path.h"
-#include "findfile.h"
#define REG_MSYSGIT_INSTALL_LOCAL L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Git_is1"
diff --git a/src/win32/findfile.h b/src/win32/findfile.h
index 3d5fff439..1eae4691c 100644
--- a/src/win32/findfile.h
+++ b/src/win32/findfile.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_git_findfile_h__
#define INCLUDE_git_findfile_h__
+#include "common.h"
+
extern int git_win32__find_system_dirs(git_buf *out, const wchar_t *subpath);
extern int git_win32__find_global_dirs(git_buf *out);
extern int git_win32__find_xdg_dirs(git_buf *out);
diff --git a/src/win32/map.c b/src/win32/map.c
index 5fcc1085b..6a17aeb64 100644
--- a/src/win32/map.c
+++ b/src/win32/map.c
@@ -5,6 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "common.h"
+
#include "map.h"
#include <errno.h>
diff --git a/src/win32/path_w32.c b/src/win32/path_w32.c
index 40b95c33b..f8416b848 100644
--- a/src/win32/path_w32.c
+++ b/src/win32/path_w32.c
@@ -5,9 +5,9 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
-#include "path.h"
#include "path_w32.h"
+
+#include "path.h"
#include "utf-conv.h"
#include "posix.h"
#include "reparse.h"
diff --git a/src/win32/path_w32.h b/src/win32/path_w32.h
index 3d9f82860..ac1fb4b9e 100644
--- a/src/win32/path_w32.h
+++ b/src/win32/path_w32.h
@@ -8,6 +8,7 @@
#define INCLUDE_git_path_w32_h__
#include "common.h"
+
#include "vector.h"
/*
diff --git a/src/win32/posix_w32.c b/src/win32/posix_w32.c
index e4fe4142c..c63414aac 100644
--- a/src/win32/posix_w32.c
+++ b/src/win32/posix_w32.c
@@ -4,6 +4,9 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
+
+#include "common.h"
+
#include "../posix.h"
#include "../fileops.h"
#include "path.h"
diff --git a/src/win32/precompiled.h b/src/win32/precompiled.h
index 10ca0b80c..851a083d5 100644
--- a/src/win32/precompiled.h
+++ b/src/win32/precompiled.h
@@ -1,3 +1,5 @@
+#include "common.h"
+
#include <assert.h>
#include <errno.h>
#include <limits.h>
@@ -20,4 +22,3 @@
#endif
#include "git2.h"
-#include "common.h"
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 87318c9d3..2d9600515 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -6,6 +6,7 @@
*/
#include "thread.h"
+
#include "../global.h"
#define CLEAN_THREAD_EXIT 0x6F012842
diff --git a/src/win32/thread.h b/src/win32/thread.h
index 7f4a2170f..d217722ec 100644
--- a/src/win32/thread.h
+++ b/src/win32/thread.h
@@ -8,7 +8,7 @@
#ifndef INCLUDE_win32_thread_h__
#define INCLUDE_win32_thread_h__
-#include "../common.h"
+#include "common.h"
#if defined (_MSC_VER)
# define GIT_RESTRICT __restrict
diff --git a/src/win32/utf-conv.c b/src/win32/utf-conv.c
index 96fd4606e..4bde3023a 100644
--- a/src/win32/utf-conv.c
+++ b/src/win32/utf-conv.c
@@ -5,7 +5,6 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "utf-conv.h"
GIT_INLINE(void) git__set_errno(void)
diff --git a/src/win32/utf-conv.h b/src/win32/utf-conv.h
index 33b95f59f..bab7ba9fd 100644
--- a/src/win32/utf-conv.h
+++ b/src/win32/utf-conv.h
@@ -7,9 +7,10 @@
#ifndef INCLUDE_git_utfconv_h__
#define INCLUDE_git_utfconv_h__
-#include <wchar.h>
#include "common.h"
+#include <wchar.h>
+
#ifndef WC_ERR_INVALID_CHARS
# define WC_ERR_INVALID_CHARS 0x80
#endif
diff --git a/src/win32/w32_buffer.c b/src/win32/w32_buffer.c
index 9122baaa6..45c024d31 100644
--- a/src/win32/w32_buffer.c
+++ b/src/win32/w32_buffer.c
@@ -5,8 +5,8 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
#include "w32_buffer.h"
+
#include "../buffer.h"
#include "utf-conv.h"
diff --git a/src/win32/w32_buffer.h b/src/win32/w32_buffer.h
index 62243986f..e15ea6864 100644
--- a/src/win32/w32_buffer.h
+++ b/src/win32/w32_buffer.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_git_win32_buffer_h__
#define INCLUDE_git_win32_buffer_h__
+#include "common.h"
+
#include "../buffer.h"
/**
diff --git a/src/win32/w32_crtdbg_stacktrace.c b/src/win32/w32_crtdbg_stacktrace.c
index 2dbdaf45b..7b3c3fb4c 100644
--- a/src/win32/w32_crtdbg_stacktrace.c
+++ b/src/win32/w32_crtdbg_stacktrace.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "w32_crtdbg_stacktrace.h"
+
#if defined(GIT_MSVC_CRTDBG)
#include "w32_stack.h"
-#include "w32_crtdbg_stacktrace.h"
#define CRTDBG_STACKTRACE__UID_LEN (15)
diff --git a/src/win32/w32_crtdbg_stacktrace.h b/src/win32/w32_crtdbg_stacktrace.h
index 2e44fd7cb..bb869b347 100644
--- a/src/win32/w32_crtdbg_stacktrace.h
+++ b/src/win32/w32_crtdbg_stacktrace.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_w32_crtdbg_stacktrace_h__
#define INCLUDE_w32_crtdbg_stacktrace_h__
+#include "common.h"
+
#if defined(GIT_MSVC_CRTDBG)
#include <stdlib.h>
diff --git a/src/win32/w32_stack.c b/src/win32/w32_stack.c
index 15af3dcb7..b40f9d2b4 100644
--- a/src/win32/w32_stack.c
+++ b/src/win32/w32_stack.c
@@ -5,11 +5,12 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "w32_stack.h"
+
#if defined(GIT_MSVC_CRTDBG)
#include "Windows.h"
#include "Dbghelp.h"
#include "win32/posix.h"
-#include "w32_stack.h"
#include "hash.h"
/**
diff --git a/src/win32/w32_stack.h b/src/win32/w32_stack.h
index 21170bd2f..a514ace6f 100644
--- a/src/win32/w32_stack.h
+++ b/src/win32/w32_stack.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_w32_stack_h__
#define INCLUDE_w32_stack_h__
+#include "common.h"
+
#if defined(GIT_MSVC_CRTDBG)
/**
diff --git a/src/win32/w32_util.h b/src/win32/w32_util.h
index 77973b502..d81e55a00 100644
--- a/src/win32/w32_util.h
+++ b/src/win32/w32_util.h
@@ -8,6 +8,8 @@
#ifndef INCLUDE_w32_util_h__
#define INCLUDE_w32_util_h__
+#include "common.h"
+
#include "utf-conv.h"
#include "posix.h"
#include "path_w32.h"
diff --git a/src/worktree.c b/src/worktree.c
index ede155b69..5a814a2ec 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -5,14 +5,13 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
-#include "common.h"
+#include "worktree.h"
#include "git2/branch.h"
#include "git2/commit.h"
#include "git2/worktree.h"
#include "repository.h"
-#include "worktree.h"
static bool is_worktree_dir(const char *dir)
{
diff --git a/src/worktree.h b/src/worktree.h
index 57c2e65f0..52d13cced 100644
--- a/src/worktree.h
+++ b/src/worktree.h
@@ -7,6 +7,8 @@
#ifndef INCLUDE_worktree_h__
#define INCLUDE_worktree_h__
+#include "common.h"
+
#include "git2/common.h"
#include "git2/worktree.h"
diff --git a/src/zstream.c b/src/zstream.c
index 141b49b27..4895bdb16 100644
--- a/src/zstream.c
+++ b/src/zstream.c
@@ -5,9 +5,10 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
+#include "zstream.h"
+
#include <zlib.h>
-#include "zstream.h"
#include "buffer.h"
#define ZSTREAM_BUFFER_SIZE (1024 * 1024)
diff --git a/src/zstream.h b/src/zstream.h
index f0006d32e..fcc4a3148 100644
--- a/src/zstream.h
+++ b/src/zstream.h
@@ -7,9 +7,10 @@
#ifndef INCLUDE_zstream_h__
#define INCLUDE_zstream_h__
+#include "common.h"
+
#include <zlib.h>
-#include "common.h"
#include "buffer.h"
typedef enum {