Code

Make every builtin-*.c file #include "builtin.h"
authorPeter Hagervall <hager@cs.umu.se>
Sat, 14 Jul 2007 23:14:45 +0000 (01:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 15 Jul 2007 05:44:09 +0000 (22:44 -0700)
Make every builtin-*.c file #include "builtin.h".

Also takes care of some declaration/definition mismatches.

Signed-off-by: Peter Hagervall <hager@cs.umu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 files changed:
builtin-bundle.c
builtin-checkout-index.c
builtin-fetch--tool.c
builtin-for-each-ref.c
builtin-fsck.c
builtin-gc.c
builtin-merge-base.c
builtin-merge-file.c
builtin-pack-refs.c
builtin-rerere.c
builtin-runstatus.c
builtin-show-ref.c

index 306ad29597dbf9002a44ba509c2e9d7a737b159d..6ae5ab04c95ab99538bbcf9ef2f5031e7237df3a 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "object.h"
 #include "commit.h"
index 8460f97b6637127d78b58caf2e29d25f3ad0b5a0..75377b9cab75ac75c6d5d7f79fdcf64bdb27cff2 100644 (file)
@@ -36,6 +36,7 @@
  * of "-a" causing problems (not possible in the above example,
  * but get used to it in scripting!).
  */
+#include "builtin.h"
 #include "cache.h"
 #include "strbuf.h"
 #include "quote.h"
index ed4d5de5d5e6d0bef5b29f3d21a3e58ff7778c8b..e2f8ede9ae4507ed1e431f9d14fc649f6475627d 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "refs.h"
 #include "commit.h"
index 2b218425aab2c37a826bfbe22535f2e5b7002a26..0afa1c5c41e79a05ddebb7d874956163510daf0b 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "refs.h"
 #include "object.h"
@@ -796,7 +797,7 @@ static struct ref_sort *default_sort(void)
        return sort;
 }
 
-int cmd_for_each_ref(int ac, const char **av, char *prefix)
+int cmd_for_each_ref(int ac, const char **av, const char *prefix)
 {
        int i, num_refs;
        const char *format = NULL;
index a6ef65ea321c614c7616862a44ce0af7998e5749..350ec5e1445a3743a4b9a5039d16d9dba505cf4e 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "commit.h"
 #include "tree.h"
@@ -659,7 +660,7 @@ static const char fsck_usage[] =
 "git-fsck [--tags] [--root] [[--unreachable] [--cache] [--full] "
 "[--strict] [--verbose] <head-sha1>*]";
 
-int cmd_fsck(int argc, char **argv, const char *prefix)
+int cmd_fsck(int argc, const char **argv, const char *prefix)
 {
        int i, heads;
 
index 45025fba30c1fb594a696c26a7eac11862cfd8f9..939748261041049f31d62935ec08f062bdfa6e79 100644 (file)
@@ -10,6 +10,7 @@
  * Copyright (c) 2006 Shawn O. Pearce
  */
 
+#include "builtin.h"
 #include "cache.h"
 #include "run-command.h"
 
index e35d362f2697ebc7e627f230283aedb8ed92857f..0108e22adee8b4de922a2b00b514dd4d4cf23c55 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "commit.h"
 
index 10ec63b17e6b16382f2b39e5c01cc6cf1dce448e..58deb62ac08507901c40e89aec0cea7fcdc78f1e 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "xdiff/xdiff.h"
 #include "xdiff-interface.h"
@@ -5,9 +6,9 @@
 static const char merge_file_usage[] =
 "git merge-file [-p | --stdout] [-q | --quiet] [-L name1 [-L orig [-L name2]]] file1 orig_file file2";
 
-int cmd_merge_file(int argc, char **argv, char **envp)
+int cmd_merge_file(int argc, const char **argv, const char *prefix)
 {
-       char *names[3];
+       const char *names[3];
        mmfile_t mmfs[3];
        mmbuffer_t result = {NULL, 0};
        xpparam_t xpp = {XDF_NEED_MINIMAL};
@@ -51,7 +52,7 @@ int cmd_merge_file(int argc, char **argv, char **envp)
                free(mmfs[i].ptr);
 
        if (ret >= 0) {
-               char *filename = argv[1];
+               const char *filename = argv[1];
                FILE *f = to_stdout ? stdout : fopen(filename, "wb");
 
                if (!f)
index 758499238f6d4110eb3740b77c92753edc8e5760..09df4e11a8bb89cded9be4af06bb162b7a92bd4c 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "refs.h"
 #include "object.h"
index 6ffc43d86440727cf9a782ed8fc0f68755551796..29d057c98cc255e718df540a62177101d9789abe 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "path-list.h"
 #include "xdiff/xdiff.h"
index 4b489b1214e1ae693a9b0b5166909800f5ca94ac..2db25c88bf648e4d5f2f41502fd29c5f7324e56b 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "wt-status.h"
 
index 9463ff0e69b15fc0e544259e64960bc942a98368..65051d14fde44c14d12099df656ac423bc1c347e 100644 (file)
@@ -1,3 +1,4 @@
+#include "builtin.h"
 #include "cache.h"
 #include "refs.h"
 #include "object.h"