diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/worktree.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/worktree.c b/builtin/worktree.c index 88af412d4f..68b0032428 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -1030,6 +1030,17 @@ static int remove_worktree(int ac, const char **av, const char *prefix) return ret; } +static void report_repair(int iserr, const char *path, const char *msg, void *cb_data) +{ + if (!iserr) { + printf_ln(_("repair: %s: %s"), msg, path); + } else { + int *exit_status = (int *)cb_data; + fprintf_ln(stderr, _("error: %s: %s"), msg, path); + *exit_status = 1; + } +} + static int repair(int ac, const char **av, const char *prefix) { struct option options[] = { @@ -1040,6 +1051,7 @@ static int repair(int ac, const char **av, const char *prefix) ac = parse_options(ac, av, prefix, options, worktree_usage, 0); if (ac) usage_with_options(worktree_usage, options); + repair_worktrees(report_repair, &rc); return rc; } |