mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Bugfixes for initCommand (#156)
respect --login parameter again 🚀 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/156 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		
							
								
								
									
										11
									
								
								cmd/flags.go
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								cmd/flags.go
									
									
									
									
									
								
							| @@ -81,10 +81,21 @@ var AllDefaultFlags = append([]cli.Flag{ | |||||||
|  |  | ||||||
| // initCommand returns repository and *Login based on flags | // initCommand returns repository and *Login based on flags | ||||||
| func initCommand() (*Login, string, string) { | func initCommand() (*Login, string, string) { | ||||||
|  | 	err := loadConfig(yamlConfigPath) | ||||||
|  | 	if err != nil { | ||||||
|  | 		log.Fatal("load config file failed ", yamlConfigPath) | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	login, repoPath, err := curGitRepoPath(repoValue) | 	login, repoPath, err := curGitRepoPath(repoValue) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		log.Fatal(err.Error()) | 		log.Fatal(err.Error()) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if loginValue != "" { | ||||||
|  | 		login = getLoginByName(loginValue) | ||||||
|  | 		if login == nil { | ||||||
|  | 			log.Fatal("Login name " + loginValue + " does not exist") | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	owner, repo := splitRepo(repoPath) | 	owner, repo := splitRepo(repoPath) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 6543
					6543