Skip to content

Commit

Permalink
Remove unnecessary check for the .git repository
Browse files Browse the repository at this point in the history
/Users/kentzo/Documents/Hobby/git-archive-all will perform that check.
  • Loading branch information
Kentzo committed Mar 2, 2017
1 parent 9112ed3 commit 7ecea97
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,17 +82,12 @@ def __init__(self, prefix='', exclude=True, force_sub=False, extra=None, main_re
if main_repo_abspath is None:
main_repo_abspath = path.abspath('')
elif not path.isabs(main_repo_abspath):
raise ValueError("You MUST pass absolute path to the main git repository.")
raise ValueError("main_repo_abspath must be an absolute path")

try:
path.isdir(".git") or self.run_shell("git rev-parse --git-dir > /dev/null 2>&1", main_repo_abspath)
except Exception as e:
raise ValueError("{0} not a git repository (or any of the parent directories).".format(main_repo_abspath))

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

self.prefix = prefix
self.exclude = exclude
Expand Down

0 comments on commit 7ecea97

Please sign in to comment.