Skip to content

Commit

Permalink
Bug fix: update_context() before is_bare()
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Mar 28, 2018
1 parent f3cecb4 commit 223f9d2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vcs_repo_mgr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Version control system repository manager.
#
# Author: Peter Odding <peter@peterodding.com>
# Last Change: March 8, 2018
# Last Change: March 28, 2018
# URL: https://github.com/xolox/python-vcs-repo-mgr

"""
Expand Down Expand Up @@ -1000,6 +1000,8 @@ def __init__(self, *args, **kw):
# Make sure the caller specified at least the local *or* remote.
if not (self.local or self.remote):
raise ValueError("No local and no remote repository specified! (one of the two is required)")
# Ensure that all further commands are executed in the local repository.
self.update_context()
# Abort if the caller's preference for the existence of a working
# tree doesn't match the state of an existing local repository.
if self.exists and self.bare != self.is_bare:
Expand All @@ -1013,8 +1015,6 @@ def __init__(self, *args, **kw):
actual_state=("doesn't" if self.is_bare else "does"),
location=format_path(self.local),
))
# Ensure that all further commands are executed in the local repository.
self.update_context()

def add_files(self, *filenames, **kw):
"""
Expand Down

0 comments on commit 223f9d2

Please sign in to comment.