summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2014-09-14 00:40:45 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-15 12:05:14 -0700
commit1c4b6604126781361fe89d88ace70f53079fbab5 (patch)
tree125f774a940ef6470dd828d5393a7c7500ea5b5b
parent96db324a73fdada6fbe7b63221986f8f18cc63b0 (diff)
downloadgit-da/include-compat-util-first-in-c.tar.gz
cleanups: ensure that git-compat-util.h is included firstda/include-compat-util-first-in-c
CodingGuidelines states that the first #include in C files should be git-compat-util.h or another header file that includes it, such as cache.h or builtin.h. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--bulk-checkin.c1
-rw-r--r--bulk-checkin.h2
-rw-r--r--http.c1
-rw-r--r--merge-recursive.c2
-rw-r--r--sigchain.c2
-rw-r--r--test-regex.c2
-rw-r--r--test-sigchain.c2
-rw-r--r--varint.c1
-rw-r--r--varint.h2
9 files changed, 7 insertions, 8 deletions
diff --git a/bulk-checkin.c b/bulk-checkin.c
index 98e651c284..0c4b8a7cad 100644
--- a/bulk-checkin.c
+++ b/bulk-checkin.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2011, Google Inc.
*/
+#include "cache.h"
#include "bulk-checkin.h"
#include "csum-file.h"
#include "pack.h"
diff --git a/bulk-checkin.h b/bulk-checkin.h
index 4f599f8841..fbd40fc98c 100644
--- a/bulk-checkin.h
+++ b/bulk-checkin.h
@@ -4,8 +4,6 @@
#ifndef BULK_CHECKIN_H
#define BULK_CHECKIN_H
-#include "cache.h"
-
extern int index_bulk_checkin(unsigned char sha1[],
int fd, size_t size, enum object_type type,
const char *path, unsigned flags);
diff --git a/http.c b/http.c
index c8cd50dd0c..c0663cd41f 100644
--- a/http.c
+++ b/http.c
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
#include "http.h"
#include "pack.h"
#include "sideband.h"
diff --git a/merge-recursive.c b/merge-recursive.c
index 1d332b8bbb..b55a0056e4 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -3,8 +3,8 @@
* Fredrik Kuivinen.
* The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
*/
-#include "advice.h"
#include "cache.h"
+#include "advice.h"
#include "cache-tree.h"
#include "commit.h"
#include "blob.h"
diff --git a/sigchain.c b/sigchain.c
index 1118b99e57..faa375d5d8 100644
--- a/sigchain.c
+++ b/sigchain.c
@@ -1,5 +1,5 @@
-#include "sigchain.h"
#include "cache.h"
+#include "sigchain.h"
#define SIGCHAIN_MAX_SIGNALS 32
diff --git a/test-regex.c b/test-regex.c
index b5bfd54139..0dc598ecdc 100644
--- a/test-regex.c
+++ b/test-regex.c
@@ -1,4 +1,4 @@
-#include <git-compat-util.h>
+#include "git-compat-util.h"
int main(int argc, char **argv)
{
diff --git a/test-sigchain.c b/test-sigchain.c
index 42db234e87..e499fce60f 100644
--- a/test-sigchain.c
+++ b/test-sigchain.c
@@ -1,5 +1,5 @@
-#include "sigchain.h"
#include "cache.h"
+#include "sigchain.h"
#define X(f) \
static void f(int sig) { \
diff --git a/varint.c b/varint.c
index 4ed7729496..409c4977a1 100644
--- a/varint.c
+++ b/varint.c
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
#include "varint.h"
uintmax_t decode_varint(const unsigned char **bufp)
diff --git a/varint.h b/varint.h
index 0321195796..c1c44d9a6b 100644
--- a/varint.h
+++ b/varint.h
@@ -1,8 +1,6 @@
#ifndef VARINT_H
#define VARINT_H
-#include "git-compat-util.h"
-
extern int encode_varint(uintmax_t, unsigned char *);
extern uintmax_t decode_varint(const unsigned char **);