Re: [PATCH] branch: segfault fixes and validation

2013-02-21 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > branch_get() can return NULL (so far on detached HEAD only)... Do you anticipate any other cases where the API call should validly return NULL? I offhand do not, ... > but some > code paths in builtin/branch.c cannot deal with that and cause > segfaults. Fix it.

[PATCH] branch: segfault fixes and validation

2013-02-21 Thread Nguyễn Thái Ngọc Duy
branch_get() can return NULL (so far on detached HEAD only) but some code paths in builtin/branch.c cannot deal with that and cause segfaults. Fix it. While at there, make sure to bail out when the user gives 2 or more arguments, but only the first one is processed. Reported-by: Per Cederqvist S