Fix AttributeError on merge conflict #70

merged 1 commit into from Jun 18, 2012


None yet
2 participants

jensck commented Jun 6, 2012

Whenever I get a merge conflict, legit pukes up an exception as in the example below.

Since black() looks to be expecting a str, let's give it one.

$ legit sync
Pulling commits from the server.
Error: Merge failed. Reverting.
Traceback (most recent call last):
  File "/usr/bin/legit", line 9, in 
    load_entry_point('legit==0.1.1', 'console_scripts', 'legit')()
  File "/usr/lib/python2.7/site-packages/legit/", line 45, in main
  File "/usr/lib/python2.7/site-packages/legit/", line 158, in cmd_sync
    status_log(smart_pull, 'Pulling commits from the server.')
  File "/usr/lib/python2.7/site-packages/legit/", line 80, in status_log
    log = func(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/legit/", line 119, in smart_pull
    return smart_merge('{0}/{1}'.format(remote, branch))
  File "/usr/lib/python2.7/site-packages/legit/", line 140, in smart_merge
    abort('Merge failed. Reverting.', log=why)
  File "/usr/lib/python2.7/site-packages/legit/", line 42, in abort
  File "/usr/lib/python2.7/site-packages/legit/", line 489, in handle_abort
    print black(aborted.log)
  File "/usr/lib/python2.7/site-packages/legit/", line 29, in black
    return s.encode('utf-8')
AttributeError: 'GitCommandError' object has no attribute 'encode'

This comment has been minimized.

Show comment
Hide comment

kennethreitz Jun 18, 2012




kennethreitz commented Jun 18, 2012


kennethreitz added a commit that referenced this pull request Jun 18, 2012

Merge pull request #70 from jensck/develop
Fix AttributeError on merge conflict

@kennethreitz kennethreitz merged commit 6f5c1df into kennethreitz:develop Jun 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment