avocado/core/job.py: don't attempt to run git if .git doesn't exist
When looking for the GIT commit info to log in the Avocado job log, we can optmize things a little by not running git if the ".git" directory doesn't exist at the top level. py2to3 is not being used anymore, so we don't need to check if we're running from modules from the build directory. Also, as another optmization, let's not look for the git binary until we're sure we'll be running it. Update: Use abspath to get "base_dir" location to avoid using "" when avocado is executed from main git directory. Signed-off-by: NCleber Rosa <crosa@redhat.com> Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
Showing
想要评论请 注册 或 登录