format-patch: pick up branch description when no ref is specified

We only try to get branch name in "format-patch origin" case or
similar and not "format-patch -22" where HEAD is automatically
added. Without correct branch name, branch description cannot be
added. Make sure we always get branch name.

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 23:16:37 +07:00
committed by Junio C Hamano
parent 20b630aae9
commit 5ee29aefac
2 changed files with 23 additions and 3 deletions

View File

@ -926,4 +926,11 @@ test_expect_success 'cover letter using branch description (5)' '
grep hello actual >/dev/null
'
test_expect_success 'cover letter using branch description (6)' '
git checkout rebuild-1 &&
test_config branch.rebuild-1.description hello &&
git format-patch --stdout --cover-letter -2 >actual &&
grep hello actual >/dev/null
'
test_done