make-version: Don't emit one common warning to stderr
git rev-parse @{upstream} will (obviously) fail if there is no upstream set for the current branch. This is fairly common and not problematic. Don't emit an error message to stderr when it fails. Change-Id: I4989fb19b25fefff83335061151e360c78652e88 Reviewed-on: https://code.wireshark.org/review/14151 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
parent
bf56f28e7f
commit
d679d1137d
|
@ -59,6 +59,7 @@ use strict;
|
|||
|
||||
use Time::Local;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
use POSIX qw(strftime);
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
|
@ -124,6 +125,7 @@ sub read_repo_info {
|
|||
my $repo_version;
|
||||
my $do_hack = 1;
|
||||
my $info_source = "Unknown";
|
||||
my $devnull = File::Spec->devnull();
|
||||
|
||||
# Make sure git is available.
|
||||
if (!`$git_executable --version`) {
|
||||
|
@ -191,7 +193,7 @@ sub read_repo_info {
|
|||
|
||||
# This will break in some cases. Hopefully not during
|
||||
# official package builds.
|
||||
chomp($line = qx{$git_executable --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\}});
|
||||
chomp($line = qx{$git_executable --git-dir="$srcdir"/.git rev-parse --abbrev-ref --symbolic-full-name \@\{upstream\} 2> $devnull});
|
||||
if ($? == 0 && length($line) > 1) {
|
||||
$repo_branch = basename($line);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue