summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-30 07:30:52 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-03-30 07:30:52 (GMT)
commit0c8b106b020421c346532351af36028bfdda4c37 (patch)
tree4cb48eb7fcf7afa0894e0e7119cb654a685bd68e
parentce4a706388bd26a3f897bb41a397113f1076ffc6 (diff)
downloadgit-0c8b106b020421c346532351af36028bfdda4c37.zip
git-0c8b106b020421c346532351af36028bfdda4c37.tar.gz
git-0c8b106b020421c346532351af36028bfdda4c37.tar.bz2
revision.c "..B" syntax: constness fix
The earlier change to make "..B" to mean "HEAD..B" (aka ^HEAD B) has constness gotcha GCC complains. Fix it. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--revision.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/revision.c b/revision.c
index 2cda7e0..abc8745 100644
--- a/revision.c
+++ b/revision.c
@@ -641,14 +641,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
dotdot = strstr(arg, "..");
if (dotdot) {
unsigned char from_sha1[20];
- char *next = dotdot + 2;
- char *this = arg;
- static const char HEAD[] = "HEAD";
+ const char *next = dotdot + 2;
+ const char *this = arg;
*dotdot = 0;
if (!*next)
- next = HEAD;
+ next = "HEAD";
if (dotdot == arg)
- this = HEAD;
+ this = "HEAD";
if (!get_sha1(this, from_sha1) &&
!get_sha1(next, sha1)) {
struct commit *exclude;