From ae1135dfbca05ddcd88bbcc962baf589dba143e1 Mon Sep 17 00:00:00 2001
From: Ondrej Nosek <onosek@redhat.com>
Date: Tue, 24 Mar 2020 01:23:53 +0100
Subject: [PATCH] Repair downloading sources into external directory
Signed-off-by: Ondrej Nosek <onosek@redhat.com>
---
pyrpkg/utils.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/pyrpkg/utils.py b/pyrpkg/utils.py
index e6339db..d1b79b9 100644
--- a/pyrpkg/utils.py
+++ b/pyrpkg/utils.py
@@ -185,8 +185,11 @@ def is_file_tracked(file_path, repo_path):
# create a repo object from our path
try:
repo = git.Repo(repo_path)
- except (git.InvalidGitRepositoryError, git.NoSuchPathError):
- raise RuntimeError("%s is not a valid repo" % repo_path)
+ except git.InvalidGitRepositoryError:
+ # repo_path is not a valid repo - input file is not tracked
+ return False
+ except git.NoSuchPathError:
+ raise RuntimeError("%s is not a valid path" % repo_path)
if relative_file_path in repo.untracked_files:
return False
--
2.21.1