Skip to content

Commit

Permalink
Merge pull request #2422 from dscho/add-i-p-updates
Browse files Browse the repository at this point in the history
Synchronize built-in add -i/-p patches with upstream
  • Loading branch information
dscho authored Dec 6, 2019
2 parents 8715ee2 + ca0066f commit 3e0eb64
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions add-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int pathname_entry_cmp(const void *unused_cmp_data,
}

struct collection_status {
enum { FROM_WORKTREE = 0, FROM_INDEX = 1 } phase;
enum { FROM_WORKTREE = 0, FROM_INDEX = 1 } mode;

const char *reference;

Expand Down Expand Up @@ -473,9 +473,9 @@ static void collect_changes_cb(struct diff_queue_struct *q,
}

file_item = entry->item;
adddel = s->phase == FROM_INDEX ?
adddel = s->mode == FROM_INDEX ?
&file_item->index : &file_item->worktree;
other_adddel = s->phase == FROM_INDEX ?
other_adddel = s->mode == FROM_INDEX ?
&file_item->worktree : &file_item->index;
adddel->seen = 1;
adddel->add = stat.files[i]->added;
Expand Down Expand Up @@ -526,9 +526,9 @@ static int get_modified_files(struct repository *r,
struct setup_revision_opt opt = { 0 };

if (filter == INDEX_ONLY)
s.phase = i ? FROM_WORKTREE : FROM_INDEX;
s.mode = (i == 0) ? FROM_INDEX : FROM_WORKTREE;
else
s.phase = i ? FROM_INDEX : FROM_WORKTREE;
s.mode = (i == 0) ? FROM_WORKTREE : FROM_INDEX;
s.skip_unseen = filter && i;

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

if (s.phase == FROM_INDEX)
if (s.mode == FROM_INDEX)
run_diff_index(&rev, 1);
else {
rev.diffopt.flags.ignore_dirty_submodules = 1;
Expand Down

0 comments on commit 3e0eb64

Please sign in to comment.