@matheusbsbs / matheus-bagliano / commits / dfe7effe7d
Fork 0

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>

Christian Couder committed Jul 22, 2010 at 15:18 UTC dfe7effe7d873015c8624d438b98671083c12e27
1 file changed +5 -5
builtin/revert.c
+5 -5
@@ -98,9 +98,9 @@ struct commit_message {
98 static int get_message(const char *raw_message, struct commit_message *out)
99 {
100 const char *encoding;
101 - const char *p, *abbrev;
101 + const char *abbrev, *subject;
102 + int abbrev_len, subject_len;
103 char *q;
103 - int abbrev_len, oneline_len;
104
105 if (!raw_message)
106 return -1;
@@ -121,17 +121,17 @@ static int get_message(const char *raw_message, struct commit_message *out)
121 abbrev = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
122 abbrev_len = strlen(abbrev);
123
124 - oneline_len = find_commit_subject(out->message, &p);
124 + subject_len = find_commit_subject(out->message, &subject);
125
126 out->parent_label = xmalloc(strlen("parent of ") + abbrev_len +
127 - strlen("... ") + oneline_len + 1);
127 + strlen("... ") + subject_len + 1);
128 q = out->parent_label;
129 q = mempcpy(q, "parent of ", strlen("parent of "));
130 out->label = q;
131 q = mempcpy(q, abbrev, abbrev_len);
132 q = mempcpy(q, "... ", strlen("... "));
133 out->subject = q;
134 - q = mempcpy(q, p, oneline_len);
134 + q = mempcpy(q, subject, subject_len);
135 *q = '\0';
136 return 0;
137 }