Commit cd5e33fbc2d11477aad954a6f343e791fdc7ef85

Etienne Samson 2019-11-06T11:08:23

global: DRY includes of assert.h

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"