Re: [PATCH v2] builtin/branch.c: remove useless branch_get

2018-10-17 Thread Tao Qingyun
> > branch_get sometimes returns current_branch, which can be NULL (e.g., if > > you're on a detached HEAD). Try: > > > > $ git branch HEAD > > fatal: no such branch 'HEAD' > > > > $ git branch '' > > fatal: no such branch '' > > > > However, it seems weird that we'd check those cases

[PATCH v2] builtin/branch.c: remove useless branch_get

2018-10-16 Thread Tao Qingyun
). And indeed, dropping that and letting us eventually hit create_branch() gives a much better message: $ git branch HEAD fatal: 'HEAD' is not a valid branch name. $ git branch '' fatal: '' is not a valid branch name. Signed-off-by: Tao Qingyun --- builtin/branch.c | 5 - 1 file changed

[PATCH v2] branch: trivial style fix

2018-10-16 Thread Tao Qingyun
Signed-off-by: Tao Qingyun --- builtin/branch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index c396c41533..0aa3dac27b 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -716,8 +716,7 @@ int cmd_branch(int argc, const char

Re: [PATCH] branch: trivial style fix

2018-10-16 Thread Tao Qingyun
>Sorry for the slow reply. For some reason I do not think your message >here made it to the list (but I don't see anything obviously wrong with >it). Yes, I cann't send message to the list using my email clinet, I don't know why. The only way I can make it is using `git send-email`(including this

[PATCH] builtin/branch.c: remove useless branch_get

2018-10-15 Thread Tao Qingyun
Signed-off-by: Tao Qingyun --- builtin/branch.c | 5 - 1 file changed, 5 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index c396c41533..2367703034 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -809,11 +809,6 @@ int cmd_branch(int argc, const char **argv, const

[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

[PATCH] branch: trivial style fix

2018-10-05 Thread Tao Qingyun
--- builtin/branch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index c396c41533..52aad0f602 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -222,10 +222,11 @@ static int delete_branches(int argc, const char **argv, int

[PATCH v2] refs: docstring typo

2018-09-14 Thread Tao Qingyun
Signed-off-by: Tao Qingyun --- refs/refs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 04425d6d1e..1fe5a7a22f 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -282,7 +282,7 @@ int

[PATCH] refs: docstirng typo

2018-09-14 Thread Tao Qingyun
--- refs/refs-internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs/refs-internal.h b/refs/refs-internal.h index 04425d6d1e..1fe5a7a22f 100644 --- a/refs/refs-internal.h +++ b/refs/refs-internal.h @@ -282,7 +282,7 @@ int refs_rename_ref_available(struct ref_store

test

2018-06-09 Thread Qingyun
Sorry to intrude, but I can't send a patch to the maillist using qq.com SMTP server.