Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-12-19 22:33:56 +0300
committerJunio C Hamano <gitster@pobox.com>2017-12-19 22:33:56 +0300
commite7d1b526d18fcbfb7a003ce971f8ce45827e495e (patch)
treedc7c7a224596609bd3a46cb6c0aab4fd539b2c92 /git-gui
parentf4f233e13daa584e5178141eb10e6e9527a3454c (diff)
parent77e422439014eca6d898107106f1758a0ffd6058 (diff)
Merge branch 'ls/git-gui-no-double-utf8-author-name'
Amending commits in git-gui broke the author name that is non-ascii due to incorrect enconding conversion. * ls/git-gui-no-double-utf8-author-name: git-gui: prevent double UTF-8 conversion
Diffstat (limited to 'git-gui')
-rw-r--r--git-gui/lib/commit.tcl12
1 files changed, 9 insertions, 3 deletions
diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
index 83620b7cbc..75ea965dac 100644
--- a/git-gui/lib/commit.tcl
+++ b/git-gui/lib/commit.tcl
@@ -25,6 +25,8 @@ You are currently in the middle of a merge that has not been fully completed. Y
set msg {}
set parents [list]
if {[catch {
+ set name ""
+ set email ""
set fd [git_read cat-file commit $curHEAD]
fconfigure $fd -encoding binary -translation lf
# By default commits are assumed to be in utf-8
@@ -34,9 +36,7 @@ You are currently in the middle of a merge that has not been fully completed. Y
lappend parents [string range $line 7 end]
} elseif {[string match {encoding *} $line]} {
set enc [string tolower [string range $line 9 end]]
- } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} {
- set commit_author [list name $name email $email date $time]
- }
+ } elseif {[regexp "author (.*)\\s<(.*)>\\s(\\d.*$)" $line all name email time]} { }
}
set msg [read $fd]
close $fd
@@ -44,7 +44,13 @@ You are currently in the middle of a merge that has not been fully completed. Y
set enc [tcl_encoding $enc]
if {$enc ne {}} {
set msg [encoding convertfrom $enc $msg]
+ set name [encoding convertfrom $enc $name]
+ set email [encoding convertfrom $enc $email]
}
+ if {$name ne {} && $email ne {}} {
+ set commit_author [list name $name email $email date $time]
+ }
+
set msg [string trim $msg]
} err]} {
error_popup [strcat [mc "Error loading commit data for amend:"] "\n\n$err"]