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>
Junio C Hamano committed
Mar 29, 2006 at 23:30 UTC
0c8b106b020421c346532351af36028bfdda4c37
1 file changed
+4
-5
revision.c
+4
-5
@@ -641,14 +641,13 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
641
dotdot = strstr(arg, "..");
642
if (dotdot) {
643
unsigned char from_sha1[20];
644
- char *next = dotdot + 2;
645
- char *this = arg;
646
- static const char HEAD[] = "HEAD";
644
+ const char *next = dotdot + 2;
645
+ const char *this = arg;
646
*dotdot = 0;
647
if (!*next)
649
- next = HEAD;
648
+ next = "HEAD";
649
if (dotdot == arg)
651
- this = HEAD;
650
+ this = "HEAD";
651
if (!get_sha1(this, from_sha1) &&
652
!get_sha1(next, sha1)) {
653
struct commit *exclude;