From d679d1137d884e651b214d8b6e3fb8af2972ad46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Thu, 25 Feb 2016 21:34:45 +0000 Subject: make-version: Don't emit one common warning to stderr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- make-version.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/make-version.pl b/make-version.pl index 76fbf2c451..880a77ce1d 100755 --- a/make-version.pl +++ b/make-version.pl @@ -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); } -- cgit v1.2.3