branch: delete branch description if it's empty

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2013-01-03 21:03:08 +07:00 committed by Junio C Hamano
parent a5ba2cbe14
commit 4b5553b5f3

View File

@ -700,7 +700,7 @@ static int edit_branch_description(const char *branch_name)
stripspace(&buf, 1);
strbuf_addf(&name, "branch.%s.description", branch_name);
status = git_config_set(name.buf, buf.buf);
status = git_config_set(name.buf, buf.len ? buf.buf : NULL);
strbuf_release(&name);
strbuf_release(&buf);