diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-03-06 20:44:17 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-07 10:47:10 -0800 |
commit | 3a55602eeca4ac8670e8698a7187e18b95683344 (patch) | |
tree | 625a8af9c4655ace00b275c3e272c2764db3bcb8 /path.c | |
parent | ff1f99453f1fe2fd9470f6ea268aed5a1839bd09 (diff) | |
download | git-3a55602eeca4ac8670e8698a7187e18b95683344.tar.gz |
General const correctness fixes
We shouldn't attempt to assign constant strings into char*, as the
string is not writable at runtime. Likewise we should always be
treating unsigned values as unsigned values, not as signed values.
Most of these are very straightforward. The only exception is the
(unnecessary) xstrdup/free in builtin-branch.c for the detached
head case. Since this is a user-level interactive type program
and that particular code path is executed no more than once, I feel
that the extra xstrdup call is well worth the easy elimination of
this warning.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'path.c')
-rw-r--r-- | path.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -252,7 +252,7 @@ char *enter_repo(char *path, int strict) if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 && validate_headref("HEAD") == 0) { - putenv("GIT_DIR=."); + setenv("GIT_DIR", ".", 1); check_repository_format(); return path; } |