Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions easybuild/tools/repository/gitrepo.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ def create_working_copy(self):
client = git.Git(self.wc)
client.clone(self.repo)
reponame = os.listdir(self.wc)[0]
self.log.debug("rep name is %s" % reponame)
self.log.debug("Repo name is %s", reponame)
except (git.GitCommandError, OSError) as err:
# it might already have existed
self.log.warning("Git local repo initialization failed, it might already exist: %s", err)

# local repo should now exist, let's connect to it again
try:
self.wc = os.path.join(self.wc, reponame)
self.log.debug("connectiong to git repo in %s" % self.wc)
self.log.debug("Connecting to git repo in %s", self.wc)
self.client = git.Git(self.wc)
except (git.GitCommandError, OSError) as err:
raise EasyBuildError("Could not create a local git repo in wc %s: %s", self.wc, err)

# try to get the remote data in the local repo
try:
res = self.client.pull()
self.log.debug("pulled succesfully to %s in %s" % (res, self.wc))
self.log.debug("Pulled succesfully to %s in %s", res, self.wc)
except (git.GitCommandError, OSError) as err:
raise EasyBuildError("pull in working copy %s went wrong: %s", self.wc, err)

Expand Down
6 changes: 4 additions & 2 deletions test/framework/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import sys
import tempfile
from test.framework.utilities import EnhancedTestCase, TestLoaderFiltered
from unittest import TextTestRunner
from unittest import TextTestRunner, mock

from easybuild.framework.easyconfig.parser import EasyConfigParser
from easybuild.tools.build_log import EasyBuildError
Expand Down Expand Up @@ -102,7 +102,9 @@ def test_gitrepo(self):
repo.init()
toy_ec_file = os.path.join(os.path.dirname(__file__), 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0.eb')
repo.add_easyconfig(toy_ec_file, 'test', '1.0', {}, None)
repo.commit("toy/0.0")
with mock.patch.dict(os.environ, {'GIT_AUTHOR_NAME': 'test', 'GIT_AUTHOR_EMAIL': 'test@test.org',
'GIT_COMMITTER_NAME': 'test', 'GIT_COMMITTER_EMAIL': 'test@test.org'}):
repo.commit("toy/0.0")

log_regex = re.compile(r"toy/0.0 with EasyBuild v%s @ .* \(time: .*, user: .*\)" % VERSION, re.M)
logmsg = repo.client.log('HEAD^!')
Expand Down
Loading