branch: delete branch description if it's empty
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Thu, 3 Jan 2013 14:03:08 +0000 (21:03 +0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 3 Jan 2013 15:43:12 +0000 (07:43 -0800)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/branch.c

index 0e060f2e4a982efdda0f88d021e0a9d3f23c6b75..a6d33502f238168a604ca10455cc46239c06745a 100644 (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);