No need of 'no branch' condition

parent 199bd563
......@@ -49,9 +49,9 @@ class Recipe(object):
if not self.url:
raise ValueError('url parameter is mandatory.')
if self.revision and self.branch:
if self.revision and self.branch != GIT_DEFAULT_BRANCH_NAME:
# revision and branch options are incompatible
raise ValueError('revision and branch parameters are set but are'
raise ValueError('revision and branch parameters are set but are '
'incompatible. Please specify only one of them.')
......@@ -86,8 +86,8 @@ class Recipe(object):
def update(self):
"""
Do a git fetch.
If user doesn't develop, reset to remote HEAD (or revision or branch if
specified.)
If user doesn't develop, reset to remote revision (or branch if revision is
not specified.)
"""
check_call([self.git_command, 'fetch', '--all'], cwd=self.location)
......@@ -96,9 +96,6 @@ class Recipe(object):
if not self.develop:
if self.revision:
self.gitReset(self.revision)
elif self.branch:
self.gitReset('%s/%s' % (
GIT_DEFAULT_REMOTE_NAME, self.branch))
else:
self.gitReset('%s/%s' % (
GIT_DEFAULT_REMOTE_NAME, GIT_DEFAULT_BRANCH_NAME))
GIT_DEFAULT_REMOTE_NAME, self.branch))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment