alexcouper / captainhook

Git hook scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Determining if there are changes to stash fails if there is unicode in the stashable diff

OddBloke opened this issue · comments

This looks like it's actually a problem with bash though:

Traceback (most recent call last):
  File ".git/hooks/pre-commit", line 122, in <module>
    exit_code = main(stash=not args.nostash)
  File ".git/hooks/pre-commit", line 97, in main
    with gitstash(stash):
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File ".git/hooks/pre-commit", line 75, in gitstash
    if stash and not changes_to_stash():
  File ".git/hooks/pre-commit", line 64, in changes_to_stash
    return bool(bash('git diff'))
  File "/home/daniel/dev/ott/.git/hooks/checkers/utils.py", line 34, in __nonzero__
    return self.__bool__()
  File "/home/daniel/dev/ott/.git/hooks/checkers/utils.py", line 37, in __bool__
    return bool(str(self))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 2487: ordinal not in range(128)