Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
revert: rename variables related to subject in get_message()
author
Christian Couder
<chriscool@tuxfamily.org>
Thu, 22 Jul 2010 13:18:31 +0000
(15:18 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 23 Jul 2010 23:10:58 +0000
(16:10 -0700)
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>
builtin/revert.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
11af2aa
)
diff --git
a/builtin/revert.c
b/builtin/revert.c
index d47794495abcbb31b39258adee57d4f9c6c3fe75..6d1b9ca1a5889525bdc7b1464f3bd8801093b1c1 100644
(file)
--- 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;
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;
char *q;
- int abbrev_len, oneline_len;
if (!raw_message)
return -1;
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);
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 +
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 = 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;
}
*q = '\0';
return 0;
}