Skip to content

Commit 3e0eb64

Browse files
authored
Merge pull request #2422 from dscho/add-i-p-updates
Synchronize built-in add -i/-p patches with upstream
2 parents 8715ee2 + ca0066f commit 3e0eb64

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

add-interactive.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static int pathname_entry_cmp(const void *unused_cmp_data,
427427
}
428428

429429
struct collection_status {
430-
enum { FROM_WORKTREE = 0, FROM_INDEX = 1 } phase;
430+
enum { FROM_WORKTREE = 0, FROM_INDEX = 1 } mode;
431431

432432
const char *reference;
433433

@@ -473,9 +473,9 @@ static void collect_changes_cb(struct diff_queue_struct *q,
473473
}
474474

475475
file_item = entry->item;
476-
adddel = s->phase == FROM_INDEX ?
476+
adddel = s->mode == FROM_INDEX ?
477477
&file_item->index : &file_item->worktree;
478-
other_adddel = s->phase == FROM_INDEX ?
478+
other_adddel = s->mode == FROM_INDEX ?
479479
&file_item->worktree : &file_item->index;
480480
adddel->seen = 1;
481481
adddel->add = stat.files[i]->added;
@@ -526,9 +526,9 @@ static int get_modified_files(struct repository *r,
526526
struct setup_revision_opt opt = { 0 };
527527

528528
if (filter == INDEX_ONLY)
529-
s.phase = i ? FROM_WORKTREE : FROM_INDEX;
529+
s.mode = (i == 0) ? FROM_INDEX : FROM_WORKTREE;
530530
else
531-
s.phase = i ? FROM_INDEX : FROM_WORKTREE;
531+
s.mode = (i == 0) ? FROM_WORKTREE : FROM_INDEX;
532532
s.skip_unseen = filter && i;
533533

534534
opt.def = is_initial ?
@@ -544,7 +544,7 @@ static int get_modified_files(struct repository *r,
544544
if (ps)
545545
copy_pathspec(&rev.prune_data, ps);
546546

547-
if (s.phase == FROM_INDEX)
547+
if (s.mode == FROM_INDEX)
548548
run_diff_index(&rev, 1);
549549
else {
550550
rev.diffopt.flags.ignore_dirty_submodules = 1;

0 commit comments

Comments
 (0)