From 2bf626e440e164f5af2d3083b8e0b79af32252d8 Mon Sep 17 00:00:00 2001 From: Chris Weyl Date: Tue, 8 Nov 2016 19:49:42 -0600 Subject: [PATCH] ensure _source_branch is never a tag If you're releasing to the CPAN where your HEAD is also tagged, _source_branch's default would populate the attribute with the tag name. This is sub-optimal, and tends to result in things like: fatal: update_ref failed for ref 'refs/heads/build/tags/0.006^0': refusing to update ref with bad name 'refs/heads/build/tags/0.006^0' The fix is to constrain the set of refs name-rev uses to name a commit to the set of branches. --- lib/Dist/Zilla/Plugin/Git/CommitBuild.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Dist/Zilla/Plugin/Git/CommitBuild.pm b/lib/Dist/Zilla/Plugin/Git/CommitBuild.pm index 40ecec3..4ab4f20 100644 --- a/lib/Dist/Zilla/Plugin/Git/CommitBuild.pm +++ b/lib/Dist/Zilla/Plugin/Git/CommitBuild.pm @@ -61,7 +61,7 @@ has _source_branch => ( lazy => 1, init_arg=> undef, default => sub { - ($_[0]->git->name_rev( '--name-only', 'HEAD' ))[0]; + ($_[0]->git->name_rev( '--name-only', '--refs=refs/heads/*', 'HEAD' ))[0]; }, );