usage = command.usage.split('\n')[0].strip()
parser = OptionParser(usage = usage, option_list = command.options)
options, args = parser.parse_args()
+ directory = command.directory
# These modules are only used from this point onwards and do not
# need to be imported earlier
from stgit.stack import Series
try:
- debug_level = int(os.environ['STGIT_DEBUG_LEVEL'])
- except KeyError:
- debug_level = 0
+ debug_level = int(os.environ.get('STGIT_DEBUG_LEVEL', 0))
except ValueError:
out.error('Invalid STGIT_DEBUG_LEVEL environment variable')
sys.exit(1)
try:
+ directory.setup()
config_setup()
# 'clone' doesn't expect an already initialised GIT tree. A Series