Skip to content
Browse files

[FIXED] Error building when git branch name contains dashes ('-')

The regex in replace_build was incorrect. The '-' character has a special meaning of 'a range of characters' unless it's at the beginning or end of the [] thing.
  • Loading branch information...
1 parent fc36b28 commit 61c3c1d3169a21206baa3e9acf3e406b47a0bd0f @subtleGradient subtleGradient committed Aug 14, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 packager.php
View
4 packager.php
@@ -125,9 +125,9 @@ private function replace_build($package_path, $file){
$ref = @file_get_contents($package_path . '.git/HEAD');
if (empty($ref)) return $file;
- preg_match("@ref: ([\w\.-/]+)@", $ref, $matches);
+ preg_match("@ref: ([\w\./-]+)@", $ref, $matches);
$ref = file_get_contents($package_path . ".git/" . $matches[1]);
- preg_match("@([\w\.-/]+)@", $ref, $matches);
+ preg_match("@([\w\./-]+)@", $ref, $matches);
return str_replace("%build%", $matches[1], $file);
}

0 comments on commit 61c3c1d

Please sign in to comment.
Something went wrong with that request. Please try again.