perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}
authorChristian Couder <christian.couder@gmail.com>
Fri, 5 Jan 2018 09:12:20 +0000 (10:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jan 2018 20:31:07 +0000 (12:31 -0800)
The way we check ENV{GIT_PERF_SUBSECTION} could trigger
comparison between undef and "" that may be flagged by
use of strict & warnings. Let's fix that.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/perf/aggregate.perl
index e40120848837c1ef78cf75d1724c69226823db15..769d418708f25c598448fa00514d903d2664c053 100755 (executable)
@@ -70,7 +70,7 @@ sub format_times {
 }
 
 my $resultsdir = "test-results";
-if ($ENV{GIT_PERF_SUBSECTION} ne "") {
+if (exists $ENV{GIT_PERF_SUBSECTION} and $ENV{GIT_PERF_SUBSECTION} ne "") {
        $resultsdir .= "/" . $ENV{GIT_PERF_SUBSECTION};
 }