Re: [PATCH v3 07/14] remote.c: introduce branch_get_upstream helper

2015-05-21 Thread Junio C Hamano
Jeff King p...@peff.net writes: All of the information needed to find the @{upstream} of a branch is included in the branch struct, but callers have to navigate a series of possible-NULL values to get there. Let's wrap that logic up in an easy-to-read helper. Signed-off-by: Jeff King

Re: [PATCH v3 07/14] remote.c: introduce branch_get_upstream helper

2015-05-21 Thread Jeff King
On Thu, May 21, 2015 at 02:14:29PM -0400, Jeff King wrote: There is a related cleanup I resisted, which is that several call-sites will call stat_tracking_info, then later look directly at branch-merge[0]-dst without a check for NULL (fill_tracking_info is such a site). This works because

Re: [PATCH v3 07/14] remote.c: introduce branch_get_upstream helper

2015-05-21 Thread Jeff King
On Thu, May 21, 2015 at 11:07:33AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: All of the information needed to find the @{upstream} of a branch is included in the branch struct, but callers have to navigate a series of possible-NULL values to get there. Let's wrap

Re: [PATCH v3 07/14] remote.c: introduce branch_get_upstream helper

2015-05-21 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Thu, May 21, 2015 at 02:14:29PM -0400, Jeff King wrote: There is a related cleanup I resisted, which is that several call-sites will call stat_tracking_info, then later look directly at branch-merge[0]-dst without a check for NULL (fill_tracking_info is

[PATCH v3 07/14] remote.c: introduce branch_get_upstream helper

2015-05-20 Thread Jeff King
All of the information needed to find the @{upstream} of a branch is included in the branch struct, but callers have to navigate a series of possible-NULL values to get there. Let's wrap that logic up in an easy-to-read helper. Signed-off-by: Jeff King p...@peff.net --- builtin/branch.c |