cleanups: ensure that git-compat-util.h is included first

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>

David Aguilar committed Sep 14, 2014 at 00:40 UTC 1c4b6604126781361fe89d88ace70f53079fbab5
9 files changed +7 -8
bulk-checkin.c
+1
@@ -1,6 +1,7 @@
1 /*
2 * Copyright (c) 2011, Google Inc.
3 */
4 +#include "cache.h"
5 #include "bulk-checkin.h"
6 #include "csum-file.h"
7 #include "pack.h"
bulk-checkin.h
-2
@@ -4,8 +4,6 @@
4 #ifndef BULK_CHECKIN_H
5 #define BULK_CHECKIN_H
6
7 -#include "cache.h"
8 -
7 extern int index_bulk_checkin(unsigned char sha1[],
8 int fd, size_t size, enum object_type type,
9 const char *path, unsigned flags);
http.c
+1
@@ -1,3 +1,4 @@
1 +#include "git-compat-util.h"
2 #include "http.h"
3 #include "pack.h"
4 #include "sideband.h"
merge-recursive.c
+1 -1
@@ -3,8 +3,8 @@
3 * Fredrik Kuivinen.
4 * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
5 */
6 -#include "advice.h"
6 #include "cache.h"
7 +#include "advice.h"
8 #include "cache-tree.h"
9 #include "commit.h"
10 #include "blob.h"
sigchain.c
+1 -1
@@ -1,5 +1,5 @@
1 -#include "sigchain.h"
1 #include "cache.h"
2 +#include "sigchain.h"
3
4 #define SIGCHAIN_MAX_SIGNALS 32
5
test-regex.c
+1 -1
@@ -1,4 +1,4 @@
1 -#include <git-compat-util.h>
1 +#include "git-compat-util.h"
2
3 int main(int argc, char **argv)
4 {
test-sigchain.c
+1 -1
@@ -1,5 +1,5 @@
1 -#include "sigchain.h"
1 #include "cache.h"
2 +#include "sigchain.h"
3
4 #define X(f) \
5 static void f(int sig) { \
varint.c
+1
@@ -1,3 +1,4 @@
1 +#include "git-compat-util.h"
2 #include "varint.h"
3
4 uintmax_t decode_varint(const unsigned char **bufp)
varint.h
-2
@@ -1,8 +1,6 @@
1 #ifndef VARINT_H
2 #define VARINT_H
3
4 -#include "git-compat-util.h"
5 -
4 extern int encode_varint(uintmax_t, unsigned char *);
5 extern uintmax_t decode_varint(const unsigned char **);
6