@matheusbsbs / matheus-bagliano / commits / 16cee38ae2
Fork 0

rev-parse: tighten constness properly.

Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Jun 5, 2006 at 22:36 UTC 16cee38ae2bff93a4e4c512550fb4ccac035a3a1
1 file changed +5 -5
builtin-rev-parse.c
+5 -5
@@ -15,7 +15,7 @@
15 #define DO_NONFLAGS 8
16 static int filter = ~0;
17
18 -static char *def = NULL;
18 +static const char *def = NULL;
19
20 #define NORMAL 0
21 #define REVERSED 1
@@ -111,7 +111,7 @@ static void show_rev(int type, const unsigned char *sha1, const char *name)
111 }
112
113 /* Output a flag, only if filter allows it. */
114 -static int show_flag(char *arg)
114 +static int show_flag(const char *arg)
115 {
116 if (!(filter & DO_FLAGS))
117 return 0;
@@ -124,7 +124,7 @@ static int show_flag(char *arg)
124
125 static void show_default(void)
126 {
127 - char *s = def;
127 + const char *s = def;
128
129 if (s) {
130 unsigned char sha1[20];
@@ -173,7 +173,7 @@ int cmd_rev_parse(int argc, const char **argv, char **envp)
173 git_config(git_default_config);
174
175 for (i = 1; i < argc; i++) {
176 - char *arg = argv[i];
176 + const char *arg = argv[i];
177 char *dotdot;
178
179 if (as_is) {
@@ -330,7 +330,7 @@ int cmd_rev_parse(int argc, const char **argv, char **envp)
330 if (dotdot) {
331 unsigned char end[20];
332 char *next = dotdot + 2;
333 - char *this = arg;
333 + const char *this = arg;
334 *dotdot = 0;
335 if (!*next)
336 next = "HEAD";