Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit Ashiwal <rohit.ashiwal265@gmail.com>2019-11-01 17:00:01 +0300
committerJunio C Hamano <gitster@pobox.com>2019-11-02 09:36:23 +0300
commit0185c683c90baed447e96c18aafb705c91012b25 (patch)
tree194ce6ff7c19259abf7a5e2c91455910029d9f55 /sequencer.c
parentcbd8db17acb77ea646c739bf96c31fe7484bc491 (diff)
sequencer: rename amend_author to author_to_rename
The purpose of amend_author was to free() the malloc()'d string obtained from get_author() while amending a commit. But we can also use the variable to free() the author at our convenience. Rename it to convey this meaning. Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index dfd7f2565f..df239babe9 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -1354,7 +1354,7 @@ static int try_to_commit(struct repository *r,
struct commit_extra_header *extra = NULL;
struct strbuf err = STRBUF_INIT;
struct strbuf commit_msg = STRBUF_INIT;
- char *amend_author = NULL;
+ char *author_to_free = NULL;
const char *hook_commit = NULL;
enum commit_msg_cleanup_mode cleanup;
int res = 0;
@@ -1375,7 +1375,7 @@ static int try_to_commit(struct repository *r,
strbuf_addstr(msg, orig_message);
hook_commit = "HEAD";
}
- author = amend_author = get_author(message);
+ author = author_to_free = get_author(message);
unuse_commit_buffer(current_head, message);
if (!author) {
res = error(_("unable to parse commit author"));
@@ -1474,7 +1474,7 @@ out:
free_commit_extra_headers(extra);
strbuf_release(&err);
strbuf_release(&commit_msg);
- free(amend_author);
+ free(author_to_free);
return res;
}