Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit ee205375a963f0d44c8728cf881169683c9b912d 1 parent ad79050
@iabyn iabyn authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  make_patchnum.pl
View
3  make_patchnum.pl
@@ -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");
Please sign in to comment.
Something went wrong with that request. Please try again.