From 93e4c4f6bdd04a86a105e4548acf966772be51b7 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 17 Aug 2007 23:59:37 +0200 Subject: [PATCH] status: make it possible to batch updates by pressing on the section line --- tig.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tig.c b/tig.c index 0a42ee2..50fbaa7 100644 --- a/tig.c +++ b/tig.c @@ -3139,7 +3139,6 @@ status_update_file(struct view *view, struct status *status, enum line_type type if (written != bufsize) return FALSE; - open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); return TRUE; } @@ -3152,12 +3151,21 @@ status_update(struct view *view) assert(view->lines); if (!line->data) { - report("No file has been chosen"); - return; - } + if (line[1].type == LINE_STAT_NONE) { + report("Nothing to update"); + return; + } - if (!status_update_file(view, line->data, line->type)) + while (++line < view->line + view->lines && line->data) { + if (!status_update_file(view, line->data, line->type)) + report("Failed to update file status"); + } + + } else if (!status_update_file(view, line->data, line->type)) { report("Failed to update file status"); + } + + open_view(view, REQ_VIEW_STATUS, OPEN_RELOAD); } else { report("This action is only valid for the status view"); } -- 2.32.0.93.g670b81a890