Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-02 Thread Duy Nguyen
On Thu, Jun 2, 2016 at 1:57 AM, David Turner wrote: >> + struct index_state istate; >> + >> + memset(&istate, 0, sizeof(istate)); > > > Why not just struct index_state istate = {0}; ? > My first thought was.. "hmm.. C99?" but then there are 24 of them in the code base alre

Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-02 Thread Duy Nguyen
On Thu, Jun 2, 2016 at 1:13 AM, Eric Sunshine wrote: > On Wed, Jun 1, 2016 at 6:45 AM, Nguyễn Thái Ngọc Duy > wrote: >> Current mark_reachable_objects() only marks objects from index from >> _current_ worktree as reachable instead of all worktrees. Because this >> function is used for pruning, t

Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-01 Thread David Turner
On Wed, 2016-06-01 at 17:45 +0700, Nguyễn Thái Ngọc Duy wrote: > Current mark_reachable_objects() only marks objects from index from > _current_ worktree as reachable instead of all worktrees. Because > this > function is used for pruning, there is a chance that objects > referenced > by other work

Re: [PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-01 Thread Eric Sunshine
On Wed, Jun 1, 2016 at 6:45 AM, Nguyễn Thái Ngọc Duy wrote: > Current mark_reachable_objects() only marks objects from index from > _current_ worktree as reachable instead of all worktrees. Because this > function is used for pruning, there is a chance that objects referenced > by other worktrees

[PATCH 2/4] reachable.c: mark reachable objects in index from all worktrees

2016-06-01 Thread Nguyễn Thái Ngọc Duy
Current mark_reachable_objects() only marks objects from index from _current_ worktree as reachable instead of all worktrees. Because this function is used for pruning, there is a chance that objects referenced by other worktrees may be deleted. Fix that. Small behavior change in "one worktree" ca