Re: [Question] builtin/branch.c

2018-10-15 Thread Jeff King
On Sun, Oct 14, 2018 at 12:19:35PM +0200, Ævar Arnfjörð Bjarmason wrote: > On Sat, Oct 13, 2018 at 10:12 AM Tao Qingyun wrote: > > Hi, I am learning `builtin/branch.c`. I find that it will call `branch_get` > > before create and [un]set upstream, and die with "no such branch" if failed. > > but

Re: [Question] builtin/branch.c

2018-10-14 Thread Ævar Arnfjörð Bjarmason
On Sat, Oct 13, 2018 at 10:12 AM Tao Qingyun wrote: > Hi, I am learning `builtin/branch.c`. I find that it will call `branch_get` > before create and [un]set upstream, and die with "no such branch" if failed. > but `branch_get` seems never fail, it is a get_or_create. Also, it was > confused that

[Question] builtin/branch.c

2018-10-13 Thread Tao Qingyun
Hi, I am learning `builtin/branch.c`. I find that it will call `branch_get` before create and [un]set upstream, and die with "no such branch" if failed. but `branch_get` seems never fail, it is a get_or_create. Also, it was confused that getting a branch before it has created. builtin/branch.c