Skip to content

Commit

Permalink
reset.c: inline update_index_refresh()
Browse files Browse the repository at this point in the history
Now that there is only one caller left to the single-line method
update_index_refresh(), inline it.

Signed-off-by: Martin von Zweigbergk <martinvonz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Martin von Zweigbergk authored and Junio C Hamano committed Jan 15, 2013
1 parent 3bbf2f2 commit 7637df1
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ static void print_new_head_line(struct commit *commit)
printf("\n");
}

static void update_index_refresh(int flags)
{
refresh_index(&the_index, (flags), NULL, NULL,
_("Unstaged changes after reset:"));
}

static void update_index_from_diff(struct diff_queue_struct *q,
struct diff_options *opt, void *data)
{
Expand Down Expand Up @@ -329,9 +323,11 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
die(_("Could not reset index file to revision '%s'."), rev);
}

if (reset_type == MIXED) /* Report what has not been updated. */
update_index_refresh(
quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
if (reset_type == MIXED) { /* Report what has not been updated. */
int flags = quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN;
refresh_index(&the_index, flags, NULL, NULL,
_("Unstaged changes after reset:"));
}

if (write_cache(newfd, active_cache, active_nr) ||
commit_locked_index(lock))
Expand Down

0 comments on commit 7637df1

Please sign in to comment.