From f939d14e0c16243d887bdc864d562785550d1259 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Tue, 19 Apr 2016 01:48:16 +0200 Subject: Check that .git/config file exists before attempting to open it --- SBO-Lib/lib/SBO/Lib.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'SBO-Lib/lib/SBO/Lib.pm') diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 0a4508c..50cb96b 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -342,6 +342,7 @@ sub git_sbo_tree { sub check_git_remote { script_error('check_git_remote requires two arguments.') unless @_ == 2; my ($path, $url) = @_; + return 0 unless -f "$path/.git/config"; my ($fh, $exit) = open_read("$path/.git/config"); return 0 if $exit; -- cgit v1.2.3