[PATCH 1/2 v4] worktree: add 'for_each_worktree' function

2015-08-13 Thread Michael Rappazzo
for_each_worktree iterates through each worktree and invokes a callback function. The main worktree (if not bare) is always encountered first, followed by worktrees created by `git worktree add`. If the callback function returns a non-zero value, iteration stops, and the callback's return value

Re: [PATCH 1/2 v4] worktree: add 'for_each_worktree' function

2015-08-13 Thread David Turner
On Thu, 2015-08-13 at 14:32 -0400, Michael Rappazzo wrote: for_each_worktree iterates through each worktree and invokes a callback function. The main worktree (if not bare) is always encountered first, followed by worktrees created by `git worktree add`. Thanks! This will be super-useful! I

Re: [PATCH 1/2 v4] worktree: add 'for_each_worktree' function

2015-08-13 Thread Mike Rappazzo
I will reroll this series with adjustments as you suggested, and I will add the extra tests for bare repos. On Thu, Aug 13, 2015 at 3:23 PM, David Turner dtur...@twopensource.com wrote: The scope of d can be smaller; move it down to the place I've marked below I have adjusted the scoping. I