summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-03-06 22:54:07 (GMT)
commit169c9c0169a00876f699678ac66ebe9563b0c29f (patch)
tree5344fd15a9134aa92eaf79ff5959f616cceffa17 /remote.c
parentc14d5f99cd91347db3978c58c4b24d60ca29af75 (diff)
parentefdfe11f4f1f901db1ebfa7ebda6337293a2e5c5 (diff)
downloadgit-169c9c0169a00876f699678ac66ebe9563b0c29f.zip
git-169c9c0169a00876f699678ac66ebe9563b0c29f.tar.gz
git-169c9c0169a00876f699678ac66ebe9563b0c29f.tar.bz2
Merge branch 'bw/c-plus-plus'
Avoid using identifiers that clash with C++ keywords. Even though it is not a goal to compile Git with C++ compilers, changes like this help use of code analysis tools that targets C++ on our codebase. * bw/c-plus-plus: (37 commits) replace: rename 'new' variables trailer: rename 'template' variables tempfile: rename 'template' variables wrapper: rename 'template' variables environment: rename 'namespace' variables diff: rename 'template' variables environment: rename 'template' variables init-db: rename 'template' variables unpack-trees: rename 'new' variables trailer: rename 'new' variables submodule: rename 'new' variables split-index: rename 'new' variables remote: rename 'new' variables ref-filter: rename 'new' variables read-cache: rename 'new' variables line-log: rename 'new' variables imap-send: rename 'new' variables http: rename 'new' variables entry: rename 'new' variables diffcore-delta: rename 'new' variables ...
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/remote.c b/remote.c
index d670eed..a9b4853 100644
--- a/remote.c
+++ b/remote.c
@@ -1985,33 +1985,33 @@ static void unmark_and_free(struct commit_list *list, unsigned int mark)
int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
{
struct object *o;
- struct commit *old, *new;
+ struct commit *old_commit, *new_commit;
struct commit_list *list, *used;
int found = 0;
/*
- * Both new and old must be commit-ish and new is descendant of
- * old. Otherwise we require --force.
+ * Both new_commit and old_commit must be commit-ish and new_commit is descendant of
+ * old_commit. Otherwise we require --force.
*/
o = deref_tag(parse_object(old_oid), NULL, 0);
if (!o || o->type != OBJ_COMMIT)
return 0;
- old = (struct commit *) o;
+ old_commit = (struct commit *) o;
o = deref_tag(parse_object(new_oid), NULL, 0);
if (!o || o->type != OBJ_COMMIT)
return 0;
- new = (struct commit *) o;
+ new_commit = (struct commit *) o;
- if (parse_commit(new) < 0)
+ if (parse_commit(new_commit) < 0)
return 0;
used = list = NULL;
- commit_list_insert(new, &list);
+ commit_list_insert(new_commit, &list);
while (list) {
- new = pop_most_recent_commit(&list, TMP_MARK);
- commit_list_insert(new, &used);
- if (new == old) {
+ new_commit = pop_most_recent_commit(&list, TMP_MARK);
+ commit_list_insert(new_commit, &used);
+ if (new_commit == old_commit) {
found = 1;
break;
}