projects
/
sgblog.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7eb7819
)
Work with From without name
author
Sergey Matveev <stargrave@stargrave.org>
Tue, 14 Jan 2020 20:25:33 +0000 (23:25 +0300)
committer
Sergey Matveev <stargrave@stargrave.org>
Tue, 14 Jan 2020 20:25:33 +0000 (23:25 +0300)
cmd/sgblog-comment-add/main.go
patch
|
blob
|
history
diff --git
a/cmd/sgblog-comment-add/main.go
b/cmd/sgblog-comment-add/main.go
index 728f34e2fe17e359cb2b3096a3864908932bb282..b967d949d90bfd399d8f71db02b8e7975c6b9e3f 100644
(file)
--- a/
cmd/sgblog-comment-add/main.go
+++ b/
cmd/sgblog-comment-add/main.go
@@
-80,7
+80,13
@@
func main() {
os.Exit(0)
}
fromCols := strings.Fields(from)
- from = strings.Join(fromCols[:len(fromCols)-1], " ")
+ if len(fromCols) == 1 {
+ if idx := strings.Index(from, "@"); idx != -1 {
+ from = strings.Trim(from[:idx], "<>")
+ }
+ } else {
+ from = strings.Join(fromCols[:len(fromCols)-1], " ")
+ }
cmd := exec.Command(
*gitCmd, "--git-dir", *gitDir,