Skip to content

Commit

Permalink
rev-parse: tighten constness properly.
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jun 6, 2006
1 parent 1d84a60 commit 16cee38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions builtin-rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#define DO_NONFLAGS 8
static int filter = ~0;

static char *def = NULL;
static const char *def = NULL;

#define NORMAL 0
#define REVERSED 1
Expand Down Expand Up @@ -111,7 +111,7 @@ static void show_rev(int type, const unsigned char *sha1, const char *name)
}

/* Output a flag, only if filter allows it. */
static int show_flag(char *arg)
static int show_flag(const char *arg)
{
if (!(filter & DO_FLAGS))
return 0;
Expand All @@ -124,7 +124,7 @@ static int show_flag(char *arg)

static void show_default(void)
{
char *s = def;
const char *s = def;

if (s) {
unsigned char sha1[20];
Expand Down Expand Up @@ -173,7 +173,7 @@ int cmd_rev_parse(int argc, const char **argv, char **envp)
git_config(git_default_config);

for (i = 1; i < argc; i++) {
char *arg = argv[i];
const char *arg = argv[i];
char *dotdot;

if (as_is) {
Expand Down Expand Up @@ -330,7 +330,7 @@ int cmd_rev_parse(int argc, const char **argv, char **envp)
if (dotdot) {
unsigned char end[20];
char *next = dotdot + 2;
char *this = arg;
const char *this = arg;
*dotdot = 0;
if (!*next)
next = "HEAD";
Expand Down

0 comments on commit 16cee38

Please sign in to comment.