Skip to content

Commit 77e4224

Browse files
committed
Merge branch 'ls/no-double-utf8-author-name' of ../git-gui into ls/git-gui-no-double-utf8-author-name
* 'ls/no-double-utf8-author-name' of ../git-gui: git-gui: prevent double UTF-8 conversion
2 parents 1a4e40a + 331450f commit 77e4224

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

git-gui/lib/commit.tcl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
2525
set msg {}
2626
set parents [list]
2727
if {[catch {
28+
set name ""
29+
set email ""
2830
set fd [git_read cat-file commit $curHEAD]
2931
fconfigure $fd -encoding binary -translation lf
3032
# By default commits are assumed to be in utf-8
@@ -34,17 +36,21 @@ You are currently in the middle of a merge that has not been fully completed. Y
3436
lappend parents [string range $line 7 end]
3537
} elseif {[string match {encoding *} $line]} {
3638
set enc [string tolower [string range $line 9 end]]
37-
} elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} {
38-
set commit_author [list name $name email $email date $time]
39-
}
39+
} elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { }
4040
}
4141
set msg [read $fd]
4242
close $fd
4343

4444
set enc [tcl_encoding $enc]
4545
if {$enc ne {}} {
4646
set msg [encoding convertfrom $enc $msg]
47+
set name [encoding convertfrom $enc $name]
48+
set email [encoding convertfrom $enc $email]
4749
}
50+
if {$name ne {} && $email ne {}} {
51+
set commit_author [list name $name email $email date $time]
52+
}
53+
4854
set msg [string trim $msg]
4955
} err]} {
5056
error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"]

0 commit comments

Comments
 (0)