Skip to content

delete bom symbol #708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
delete bom symbol
  • Loading branch information
batchar2 committed Dec 8, 2017
commit c13f5bde71395c6de8fb65a1b2c84f375560a773
8 changes: 7 additions & 1 deletion git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,15 @@ def string_decode(v):
while True:
# we assume to read binary !
line = fp.readline().decode(defenc)

# Remove UTF-8 ByteOrderMark (BOM)
if lineno == 0:
line = line.replace('\ufeff', '')
if not line:
break
lineno = lineno + 1

lineno += 1

# comment or blank line?
if line.strip() == '' or self.re_comment.match(line):
continue
Expand Down