format-patch: pick up correct branch name from symbolic ref
find_branch_name() assumes to take refs/heads/<branch>. But we also have symbolic refs, such as HEAD, that can point to a valid branch in refs/heads and do not follow refs/heads/<branch> syntax. Remove the assumption and apply normal ref resolution. After all it would be confusing if rev machinery resolves a ref in one way and find_branch_name() another. 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:

committed by
Junio C Hamano

parent
e216cc48da
commit
20b630aae9
@ -912,4 +912,18 @@ test_expect_success 'cover letter using branch description (3)' '
|
||||
grep hello actual >/dev/null
|
||||
'
|
||||
|
||||
test_expect_success 'cover letter using branch description (4)' '
|
||||
git checkout rebuild-1 &&
|
||||
test_config branch.rebuild-1.description hello &&
|
||||
git format-patch --stdout --cover-letter master.. >actual &&
|
||||
grep hello actual >/dev/null
|
||||
'
|
||||
|
||||
test_expect_success 'cover letter using branch description (5)' '
|
||||
git checkout rebuild-1 &&
|
||||
test_config branch.rebuild-1.description hello &&
|
||||
git format-patch --stdout --cover-letter -2 HEAD >actual &&
|
||||
grep hello actual >/dev/null
|
||||
'
|
||||
|
||||
test_done
|
||||
|
Reference in New Issue
Block a user