Skip to content

Commit baffc0e

Browse files
Peter Hagervallgitster
authored andcommitted
Make every builtin-*.c file #include "builtin.h"
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>
1 parent 46cf98b commit baffc0e

12 files changed

+17
-5
lines changed

builtin-bundle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "object.h"
34
#include "commit.h"

builtin-checkout-index.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
* of "-a" causing problems (not possible in the above example,
3737
* but get used to it in scripting!).
3838
*/
39+
#include "builtin.h"
3940
#include "cache.h"
4041
#include "strbuf.h"
4142
#include "quote.h"

builtin-fetch--tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "refs.h"
34
#include "commit.h"

builtin-for-each-ref.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "refs.h"
34
#include "object.h"
@@ -796,7 +797,7 @@ static struct ref_sort *default_sort(void)
796797
return sort;
797798
}
798799

799-
int cmd_for_each_ref(int ac, const char **av, char *prefix)
800+
int cmd_for_each_ref(int ac, const char **av, const char *prefix)
800801
{
801802
int i, num_refs;
802803
const char *format = NULL;

builtin-fsck.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "commit.h"
34
#include "tree.h"
@@ -659,7 +660,7 @@ static const char fsck_usage[] =
659660
"git-fsck [--tags] [--root] [[--unreachable] [--cache] [--full] "
660661
"[--strict] [--verbose] <head-sha1>*]";
661662

662-
int cmd_fsck(int argc, char **argv, const char *prefix)
663+
int cmd_fsck(int argc, const char **argv, const char *prefix)
663664
{
664665
int i, heads;
665666

builtin-gc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* Copyright (c) 2006 Shawn O. Pearce
1111
*/
1212

13+
#include "builtin.h"
1314
#include "cache.h"
1415
#include "run-command.h"
1516

builtin-merge-base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "commit.h"
34

builtin-merge-file.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "xdiff/xdiff.h"
34
#include "xdiff-interface.h"
45

56
static const char merge_file_usage[] =
67
"git merge-file [-p | --stdout] [-q | --quiet] [-L name1 [-L orig [-L name2]]] file1 orig_file file2";
78

8-
int cmd_merge_file(int argc, char **argv, char **envp)
9+
int cmd_merge_file(int argc, const char **argv, const char *prefix)
910
{
10-
char *names[3];
11+
const char *names[3];
1112
mmfile_t mmfs[3];
1213
mmbuffer_t result = {NULL, 0};
1314
xpparam_t xpp = {XDF_NEED_MINIMAL};
@@ -51,7 +52,7 @@ int cmd_merge_file(int argc, char **argv, char **envp)
5152
free(mmfs[i].ptr);
5253

5354
if (ret >= 0) {
54-
char *filename = argv[1];
55+
const char *filename = argv[1];
5556
FILE *f = to_stdout ? stdout : fopen(filename, "wb");
5657

5758
if (!f)

builtin-pack-refs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "refs.h"
34
#include "object.h"

builtin-rerere.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "builtin.h"
12
#include "cache.h"
23
#include "path-list.h"
34
#include "xdiff/xdiff.h"

0 commit comments

Comments
 (0)