kas/libcmd: Instead of copying the .gitconfig, create a new dummy one

Copying the .gitconfig failes if the current user doesn't have one,
since the commits that are done within kas, will not be pushed or
merged anywhere, we can just create a minimal .gitconfig in the temp
home directory of kas.

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine 2018-03-21 16:41:10 +01:00 committed by Daniel Wagner
parent e8851a5fb3
commit 40e528065f

View File

@ -92,8 +92,10 @@ class SetupHome(Command):
fds.write('\n')
with open(self.tmpdirname + '/.netrc', 'w') as fds:
fds.write('\n')
shutil.copyfile(os.path.expanduser('~/.gitconfig'),
self.tmpdirname + '/.gitconfig')
with open(self.tmpdirname + '/.gitconfig', 'w') as fds:
fds.write('[User]\n'
'\temail = kas@example.com\n'
'\tname = Kas User\n')
config.environ['HOME'] = self.tmpdirname