Skip to content

Commit 7637df1

Browse files
martinvonzgitster
authored andcommitted
reset.c: inline update_index_refresh()
Now that there is only one caller left to the single-line method update_index_refresh(), inline it. Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3bbf2f2 commit 7637df1

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

builtin/reset.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ static void print_new_head_line(struct commit *commit)
109109
printf("\n");
110110
}
111111

112-
static void update_index_refresh(int flags)
113-
{
114-
refresh_index(&the_index, (flags), NULL, NULL,
115-
_("Unstaged changes after reset:"));
116-
}
117-
118112
static void update_index_from_diff(struct diff_queue_struct *q,
119113
struct diff_options *opt, void *data)
120114
{
@@ -329,9 +323,11 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
329323
die(_("Could not reset index file to revision '%s'."), rev);
330324
}
331325

332-
if (reset_type == MIXED) /* Report what has not been updated. */
333-
update_index_refresh(
334-
quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
326+
if (reset_type == MIXED) { /* Report what has not been updated. */
327+
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
328+
refresh_index(&the_index, flags, NULL, NULL,
329+
_("Unstaged changes after reset:"));
330+
}
335331

336332
if (write_cache(newfd, active_cache, active_nr) ||
337333
commit_locked_index(lock))

0 commit comments

Comments
 (0)