Skip to content

Commit

Permalink
fix make_patchnum.pl branch determination
Browse files Browse the repository at this point in the history
A previous commit of mine, 9077509,
tried to handle the case where the output of 'git branch' was

    * (no branch)
      blead

to stop it outputting  a 'Use of uninitialized value' warning.
However, my "fix" broke in the case where multiple branches are listed
with the current not the first:

      blead
    * tmp1
      tmp2

Hopefully this fixes it properly.
  • Loading branch information
iabyn committed Dec 12, 2011
1 parent ad79050 commit ee20537
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion make_patchnum.pl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ sub write_files {
}
elsif (-d "$srcdir/.git") {
# git branch | awk 'BEGIN{ORS=""} /\*/ { print $2 }'
($branch) = map { /\* ([^(]\S*)/ ? $1 : "" } backtick("git branch");
($branch) = map { /\* ([^(]\S*)/ ? $1 : () } backtick("git branch");
$branch //= "";
my ($remote,$merge);
if (length $branch) {
$merge= backtick("git config branch.$branch.merge");
Expand Down

0 comments on commit ee20537

Please sign in to comment.