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>
use Time::Local;
use File::Basename;
+use File::Spec;
use POSIX qw(strftime);
use Getopt::Long;
use Pod::Usage;
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`) {
# 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);
}