Skip to content

Commit

Permalink
Fix regression from "Improve staging of diff chunks"
Browse files Browse the repository at this point in the history
In commit 2349184 the change to
stage_update reads:

 static bool
 stage_update(struct view *view, struct line *line)
 {
-       if (!opt_no_head && stage_line_type != LINE_STAT_UNTRACKED &&
-           (line->type == LINE_DIFF_CHUNK || !stage_status.status)) {
-               if (!stage_update_chunk(view, line)) {

where the !stage_status.status part was meant to match whole sections.
Reinstate this behavior so that pressing 'u' when in the stage view for
a section of changes it will stage all changed files in that section.
  • Loading branch information
jonas committed Apr 10, 2008
1 parent 3003363 commit 808aeaf
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tig.c
Original file line number Diff line number Diff line change
Expand Up @@ -4548,6 +4548,18 @@ stage_update(struct view *view, struct line *line)
return FALSE;
}

} else if (!stage_status.status) {
view = VIEW(REQ_VIEW_STATUS);

for (line = view->line; line < view->line + view->lines; line++)
if (line->type == stage_line_type)
break;

if (!status_update_files(view, line + 1)) {
report("Failed to update files");
return FALSE;
}

} else if (!status_update_file(&stage_status, stage_line_type)) {
report("Failed to update file");
return FALSE;
Expand Down

0 comments on commit 808aeaf

Please sign in to comment.