Skip to content

Commit 0185c68

Browse files
r1walzgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cbd8db1 commit 0185c68

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sequencer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,7 @@ static int try_to_commit(struct repository *r,
13541354
struct commit_extra_header *extra = NULL;
13551355
struct strbuf err = STRBUF_INIT;
13561356
struct strbuf commit_msg = STRBUF_INIT;
1357-
char *amend_author = NULL;
1357+
char *author_to_free = NULL;
13581358
const char *hook_commit = NULL;
13591359
enum commit_msg_cleanup_mode cleanup;
13601360
int res = 0;
@@ -1375,7 +1375,7 @@ static int try_to_commit(struct repository *r,
13751375
strbuf_addstr(msg, orig_message);
13761376
hook_commit = "HEAD";
13771377
}
1378-
author = amend_author = get_author(message);
1378+
author = author_to_free = get_author(message);
13791379
unuse_commit_buffer(current_head, message);
13801380
if (!author) {
13811381
res = error(_("unable to parse commit author"));
@@ -1474,7 +1474,7 @@ static int try_to_commit(struct repository *r,
14741474
free_commit_extra_headers(extra);
14751475
strbuf_release(&err);
14761476
strbuf_release(&commit_msg);
1477-
free(amend_author);
1477+
free(author_to_free);
14781478

14791479
return res;
14801480
}

0 commit comments

Comments
 (0)