fix: empty commit
This commit is contained in:
		
							parent
							
								
									d299849c78
								
							
						
					
					
						commit
						e8506eeb51
					
				|  | @ -88,16 +88,26 @@ func commitMsgToConf() (conf Conf, err error) { | |||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	ref, err := r.Head() | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	commit, err := r.CommitObject(ref.Hash()) | ||||
| 	if err != nil { | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	file := "conf.toml" | ||||
| 
 | ||||
| 	msg := commit.Message | ||||
| 	slog.Debug("commit msg to conf", "msg", msg) | ||||
| 	if msg == "" { | ||||
| 		conf, err = parseConfFile(file) | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	line := strings.Split(msg, "\n")[0] | ||||
| 
 | ||||
| 	words := strings.Fields(line) | ||||
|  | @ -109,8 +119,6 @@ func commitMsgToConf() (conf Conf, err error) { | |||
| 		head = head[:len(head)-1] | ||||
| 	} | ||||
| 
 | ||||
| 	file := "conf.toml" | ||||
| 
 | ||||
| 	switch head { | ||||
| 	case "feat", "fix", "refactor", "perf", "test", "build", "revert": | ||||
| 		if len(words) < 2 { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 zzjc1234
						zzjc1234