global: DRY includes of assert.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
diff --git a/examples/add.c b/examples/add.c
index 14e69e9..b0c4f60 100644
--- a/examples/add.c
+++ b/examples/add.c
@@ -13,7 +13,6 @@
*/
#include "common.h"
-#include <assert.h>
/**
* The following example demonstrates how to add files with libgit2.
diff --git a/examples/checkout.c b/examples/checkout.c
index d552eec..b706e04 100644
--- a/examples/checkout.c
+++ b/examples/checkout.c
@@ -13,7 +13,6 @@
*/
#include "common.h"
-#include <assert.h>
/* Define the printf format specifer to use for size_t output */
#if defined(_MSC_VER) || defined(__MINGW32__)
diff --git a/examples/common.c b/examples/common.c
index 22807e1..47cfac6 100644
--- a/examples/common.c
+++ b/examples/common.c
@@ -12,7 +12,9 @@
* <http://creativecommons.org/publicdomain/zero/1.0/>.
*/
-#include <assert.h>
+
+#include "common.h"
+
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -25,7 +27,6 @@
#include <string.h>
#include <errno.h>
-#include "common.h"
void check_lg2(int error, const char *message, const char *extra)
{
diff --git a/examples/common.h b/examples/common.h
index 4f0181e..3657e53 100644
--- a/examples/common.h
+++ b/examples/common.h
@@ -14,6 +14,7 @@
#ifndef INCLUDE_examples_common_h__
#define INCLUDE_examples_common_h__
+#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
diff --git a/examples/describe.c b/examples/describe.c
index 53f548c..181e499 100644
--- a/examples/describe.c
+++ b/examples/describe.c
@@ -13,7 +13,6 @@
*/
#include "common.h"
-#include <assert.h>
/**
* The following example partially reimplements the `git describe` command
diff --git a/examples/merge.c b/examples/merge.c
index 995ac02..0cdeeea 100644
--- a/examples/merge.c
+++ b/examples/merge.c
@@ -13,7 +13,6 @@
*/
#include "common.h"
-#include <assert.h>
/** The following example demonstrates how to do merges with libgit2.
*
diff --git a/src/apply.c b/src/apply.c
index 65b057c..fc60e14 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -7,8 +7,6 @@
#include "apply.h"
-#include <assert.h>
-
#include "git2/apply.h"
#include "git2/patch.h"
#include "git2/filter.h"
diff --git a/src/checkout.c b/src/checkout.c
index d618e3d..5cfa728 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -7,8 +7,6 @@
#include "checkout.h"
-#include <assert.h>
-
#include "git2/repository.h"
#include "git2/refs.h"
#include "git2/tree.h"
diff --git a/src/clone.c b/src/clone.c
index e8972b4..3d749c3 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -7,8 +7,6 @@
#include "clone.h"
-#include <assert.h>
-
#include "git2/clone.h"
#include "git2/remote.h"
#include "git2/revparse.h"
diff --git a/src/revparse.c b/src/revparse.c
index 2618b38..c627de6 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -7,8 +7,6 @@
#include "common.h"
-#include <assert.h>
-
#include "buffer.h"
#include "tree.h"
#include "refdb.h"