Skip to content

Commit

Permalink
Fix support for repo dir names with trailing whitespaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentzo committed Nov 7, 2018
1 parent b57d7b2 commit 3c14024
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def __init__(self, prefix='', exclude=True, force_sub=False, extra=None, main_re
raise ValueError("main_repo_abspath must be an absolute path")

try:
main_repo_abspath = path.abspath(self.run_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip())
main_repo_abspath = path.abspath(self.run_git_shell('git rev-parse --show-toplevel', main_repo_abspath)[:-1])
except CalledProcessError:
raise ValueError("{0} is not part of a git repository".format(main_repo_abspath))

Expand Down Expand Up @@ -143,7 +143,7 @@ def create(self, output_path, dry_run=False, output_format=None, compresslevel=N
if output_format is None:
file_name, file_ext = path.splitext(output_path)
output_format = file_ext[len(extsep):].lower()
self.LOG.debug("Output format is not explicitly set, determined format is {0}.".format(output_format))
self.LOG.debug("Output format is not explicitly set, determined format is %s.", output_format)

if not dry_run:
if output_format in self.ZIPFILE_FORMATS:
Expand Down Expand Up @@ -184,13 +184,13 @@ def add_file(file_path, arcname):
raise ValueError("unknown format: {0}".format(output_format))

def archiver(file_path, arcname):
self.LOG.debug("{0} => {1}".format(file_path, arcname))
self.LOG.debug("%s => %s", file_path, arcname)
add_file(file_path, arcname)
else:
archive = None

def archiver(file_path, arcname):
self.LOG.info("{0} => {1}".format(file_path, arcname))
self.LOG.info("%s => %s", file_path, arcname)

self.archive_all_files(archiver)

Expand Down

0 comments on commit 3c14024

Please sign in to comment.