summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorChristian Couder <chriscool@tuxfamily.org>2010-07-22 13:18:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-07-23 23:10:58 (GMT)
commitdfe7effe7d873015c8624d438b98671083c12e27 (patch)
tree714451c6eeb663475a5de87c4b4339691c04686f /builtin
parent11af2aaed657d10dea083f5d5cb7f93bb96a7b70 (diff)
downloadgit-dfe7effe7d873015c8624d438b98671083c12e27.zip
git-dfe7effe7d873015c8624d438b98671083c12e27.tar.gz
git-dfe7effe7d873015c8624d438b98671083c12e27.tar.bz2
revert: rename variables related to subject in get_message()
Generic-looking pointer variable "p" was used only to point at subject string and had a rather lifespan. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/revert.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index d477944..6d1b9ca 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -98,9 +98,9 @@ struct commit_message {
static int get_message(const char *raw_message, struct commit_message *out)
{
const char *encoding;
- const char *p, *abbrev;
+ const char *abbrev, *subject;
+ int abbrev_len, subject_len;
char *q;
- int abbrev_len, oneline_len;
if (!raw_message)
return -1;
@@ -121,17 +121,17 @@ static int get_message(const char *raw_message, struct commit_message *out)
abbrev = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
abbrev_len = strlen(abbrev);
- oneline_len = find_commit_subject(out->message, &p);
+ subject_len = find_commit_subject(out->message, &subject);
out->parent_label = xmalloc(strlen("parent of ") + abbrev_len +
- strlen("... ") + oneline_len + 1);
+ strlen("... ") + subject_len + 1);
q = out->parent_label;
q = mempcpy(q, "parent of ", strlen("parent of "));
out->label = q;
q = mempcpy(q, abbrev, abbrev_len);
q = mempcpy(q, "... ", strlen("... "));
out->subject = q;
- q = mempcpy(q, p, oneline_len);
+ q = mempcpy(q, subject, subject_len);
*q = '\0';
return 0;
}