File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -100,25 +100,20 @@ func createSOB() (string, error) {
100
100
if err != nil {
101
101
return "" , err
102
102
}
103
- return fmt .Sprintf ("Signed-off-by: %s %s " , name , email ), nil
103
+ return fmt .Sprintf ("Signed-off-by: %s <%s> " , name , email ), nil
104
104
}
105
105
106
106
func gitAuthor () (string , string , error ) {
107
- name := "Undefined "
108
- email := "Undefined "
107
+ name := ""
108
+ email := ""
109
109
110
- msg , err := git ("var" , "GIT_AUTHOR_IDENT" )
111
- if err != nil {
112
- return "" , "" , err
113
- }
114
-
115
- authorInfo := strings .Fields (msg )
116
- if len (authorInfo ) > 1 && authorInfo [0 ] != "" {
117
- name = authorInfo [0 ]
110
+ if cfg , err := git ("config" , "user.name" ); err == nil {
111
+ name = cfg
118
112
}
119
- if len ( authorInfo ) > 2 && authorInfo [ 1 ] != "" {
120
- email = authorInfo [ 1 ]
113
+ if cfg , err := git ( "config" , "user.email" ); err == nil {
114
+ email = cfg
121
115
}
116
+
122
117
return name , email , nil
123
118
}
124
119
You can’t perform that action at this time.
0 commit comments