Skip to content

Commit 1f96960

Browse files
charvi-077gitster
authored andcommitted
sequencer: rename a few functions
Rename functions to make them more descriptive and while at it, remove unnecessary 'inline' of the skip_fixupish() function. Mentored-by: Christian Couder <[email protected]> Mentored-by: Phillip Wood <[email protected]> Helped-by: Eric Sunshine <[email protected]> Signed-off-by: Charvi Mendiratta <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a25314c commit 1f96960

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

sequencer.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ static const char skip_first_commit_msg_str[] = N_("The 1st commit message will
17441744
static const char skip_nth_commit_msg_fmt[] = N_("The commit message #%d will be skipped:");
17451745
static const char combined_commit_msg_fmt[] = N_("This is a combination of %d commits.");
17461746

1747-
static int check_fixup_flag(enum todo_command command, unsigned flag)
1747+
static int is_fixup_flag(enum todo_command command, unsigned flag)
17481748
{
17491749
return command == TODO_FIXUP && ((flag & TODO_REPLACE_FIXUP_MSG) ||
17501750
(flag & TODO_EDIT_FIXUP_MSG));
@@ -1873,7 +1873,7 @@ static int append_squash_message(struct strbuf *buf, const char *body,
18731873
strbuf_addstr(buf, body + commented_len);
18741874

18751875
/* fixup -C after squash behaves like squash */
1876-
if (check_fixup_flag(command, flag) && !seen_squash(opts)) {
1876+
if (is_fixup_flag(command, flag) && !seen_squash(opts)) {
18771877
/*
18781878
* We're replacing the commit message so we need to
18791879
* append the Signed-off-by: trailer if the user
@@ -1928,7 +1928,7 @@ static int update_squash_messages(struct repository *r,
19281928
opts->current_fixup_count + 2);
19291929
strbuf_splice(&buf, 0, eol - buf.buf, header.buf, header.len);
19301930
strbuf_release(&header);
1931-
if (check_fixup_flag(command, flag) && !seen_squash(opts))
1931+
if (is_fixup_flag(command, flag) && !seen_squash(opts))
19321932
update_squash_message_for_fixup(&buf);
19331933
} else {
19341934
struct object_id head;
@@ -1951,11 +1951,11 @@ static int update_squash_messages(struct repository *r,
19511951
strbuf_addf(&buf, "%c ", comment_line_char);
19521952
strbuf_addf(&buf, _(combined_commit_msg_fmt), 2);
19531953
strbuf_addf(&buf, "\n%c ", comment_line_char);
1954-
strbuf_addstr(&buf, check_fixup_flag(command, flag) ?
1954+
strbuf_addstr(&buf, is_fixup_flag(command, flag) ?
19551955
_(skip_first_commit_msg_str) :
19561956
_(first_commit_msg_str));
19571957
strbuf_addstr(&buf, "\n\n");
1958-
if (check_fixup_flag(command, flag))
1958+
if (is_fixup_flag(command, flag))
19591959
strbuf_add_commented_lines(&buf, body, strlen(body));
19601960
else
19611961
strbuf_addstr(&buf, body);
@@ -1968,7 +1968,7 @@ static int update_squash_messages(struct repository *r,
19681968
oid_to_hex(&commit->object.oid));
19691969
find_commit_subject(message, &body);
19701970

1971-
if (command == TODO_SQUASH || check_fixup_flag(command, flag)) {
1971+
if (command == TODO_SQUASH || is_fixup_flag(command, flag)) {
19721972
res = append_squash_message(&buf, body, command, opts, flag);
19731973
} else if (command == TODO_FIXUP) {
19741974
strbuf_addf(&buf, "\n%c ", comment_line_char);
@@ -5661,7 +5661,7 @@ static int subject2item_cmp(const void *fndata,
56615661

56625662
define_commit_slab(commit_todo_item, struct todo_item *);
56635663

5664-
static inline int skip_fixup_amend_squash(const char *subject, const char **p) {
5664+
static int skip_fixupish(const char *subject, const char **p) {
56655665
return skip_prefix(subject, "fixup! ", p) ||
56665666
skip_prefix(subject, "amend! ", p) ||
56675667
skip_prefix(subject, "squash! ", p);
@@ -5725,13 +5725,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
57255725
format_subject(&buf, subject, " ");
57265726
subject = subjects[i] = strbuf_detach(&buf, &subject_len);
57275727
unuse_commit_buffer(item->commit, commit_buffer);
5728-
if (skip_fixup_amend_squash(subject, &p)) {
5728+
if (skip_fixupish(subject, &p)) {
57295729
struct commit *commit2;
57305730

57315731
for (;;) {
57325732
while (isspace(*p))
57335733
p++;
5734-
if (!skip_fixup_amend_squash(p, &p))
5734+
if (!skip_fixupish(p, &p))
57355735
break;
57365736
}
57375737

0 commit comments

Comments
 (0)