rev-parse: rename 'this' variable
Rename C++ keyword in order to bring the codebase closer to being able to be compiled with a C++ compiler. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
095b3b2c04
commit
ae90bdce8f
|
@ -243,28 +243,28 @@ static int show_file(const char *arg, int output_prefix)
|
||||||
static int try_difference(const char *arg)
|
static int try_difference(const char *arg)
|
||||||
{
|
{
|
||||||
char *dotdot;
|
char *dotdot;
|
||||||
struct object_id oid;
|
struct object_id start_oid;
|
||||||
struct object_id end;
|
struct object_id end_oid;
|
||||||
const char *next;
|
const char *end;
|
||||||
const char *this;
|
const char *start;
|
||||||
int symmetric;
|
int symmetric;
|
||||||
static const char head_by_default[] = "HEAD";
|
static const char head_by_default[] = "HEAD";
|
||||||
|
|
||||||
if (!(dotdot = strstr(arg, "..")))
|
if (!(dotdot = strstr(arg, "..")))
|
||||||
return 0;
|
return 0;
|
||||||
next = dotdot + 2;
|
end = dotdot + 2;
|
||||||
this = arg;
|
start = arg;
|
||||||
symmetric = (*next == '.');
|
symmetric = (*end == '.');
|
||||||
|
|
||||||
*dotdot = 0;
|
*dotdot = 0;
|
||||||
next += symmetric;
|
end += symmetric;
|
||||||
|
|
||||||
if (!*next)
|
if (!*end)
|
||||||
next = head_by_default;
|
end = head_by_default;
|
||||||
if (dotdot == arg)
|
if (dotdot == arg)
|
||||||
this = head_by_default;
|
start = head_by_default;
|
||||||
|
|
||||||
if (this == head_by_default && next == head_by_default &&
|
if (start == head_by_default && end == head_by_default &&
|
||||||
!symmetric) {
|
!symmetric) {
|
||||||
/*
|
/*
|
||||||
* Just ".."? That is not a range but the
|
* Just ".."? That is not a range but the
|
||||||
|
@ -274,14 +274,14 @@ static int try_difference(const char *arg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!get_oid_committish(this, &oid) && !get_oid_committish(next, &end)) {
|
if (!get_oid_committish(start, &start_oid) && !get_oid_committish(end, &end_oid)) {
|
||||||
show_rev(NORMAL, &end, next);
|
show_rev(NORMAL, &end_oid, end);
|
||||||
show_rev(symmetric ? NORMAL : REVERSED, &oid, this);
|
show_rev(symmetric ? NORMAL : REVERSED, &start_oid, start);
|
||||||
if (symmetric) {
|
if (symmetric) {
|
||||||
struct commit_list *exclude;
|
struct commit_list *exclude;
|
||||||
struct commit *a, *b;
|
struct commit *a, *b;
|
||||||
a = lookup_commit_reference(&oid);
|
a = lookup_commit_reference(&start_oid);
|
||||||
b = lookup_commit_reference(&end);
|
b = lookup_commit_reference(&end_oid);
|
||||||
exclude = get_merge_bases(a, b);
|
exclude = get_merge_bases(a, b);
|
||||||
while (exclude) {
|
while (exclude) {
|
||||||
struct commit *commit = pop_commit(&exclude);
|
struct commit *commit = pop_commit(&exclude);
|
||||||
|
|
Loading…
Reference in New Issue