The fetchcmd option in .git/config can be set to a command that
doesn't generate a FETCH_HEAD file (like 'git svn fetch'). With this
patch, StGIT will only warn if no FETCH_HEAD is found as it is quite
likely that the rebasecmd doesn't need one ('git svn rebase'). The
patch also modifies the 'fetch-rebase' case in pull.py so that it
re-raises the exception initially raised by git.fetch_head() as this
function has the correct information about the type of exception.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
try:
target = git.fetch_head()
except git.GitException:
- out.error('Could not find the remote head to rebase onto, pushing any patches back...')
+ out.error('Could not find the remote head to rebase onto - fix branch.%s.merge in .git/config' % crt_series.get_name())
+ out.error('Pushing any patches back...')
post_rebase(crt_series, applied, False, False)
- raise CmdException, 'Could not find the remote head to rebase onto - fix branch.%s.merge in .git/config' % crt_series.get_name()
+ raise
rebase(crt_series, target)
elif policy == 'rebase':
stream.close()
if not fetch_head:
- raise GitException, 'No for-merge remote head found in FETCH_HEAD'
+ out.warn('No for-merge remote head found in FETCH_HEAD')
# here we are sure to have a single fetch_head
return fetch_head