Permalink
Browse files

fix make_patchnum.pl branch determination

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 ee205375a963f0d44c8728cf881169683c9b912d
Showing with 2 additions and 1 deletion.
  1. +2 −1 make_patchnum.pl
View
@@ -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");

0 comments on commit ee20537

Please sign in to comment.