mirror of
				https://github.com/jesseduffield/lazygit.git
				synced 2025-10-30 23:57:43 +02:00 
			
		
		
		
	Removed the username / password savety check
This check is not realy needed because the change that it will show up a second time is so low that this is more work to check than the change it actualy might happen
This commit is contained in:
		| @@ -71,27 +71,13 @@ func (c *OSCommand) DetectUnamePass(command string, ask func(string) string) err | ||||
| 	errMessage, err := c.RunCommandWithOutputLive(command, func(word string) string { | ||||
| 		ttyText = ttyText + " " + word | ||||
|  | ||||
| 		type Prompt struct { | ||||
| 			pattern   string | ||||
| 			canAskFor bool | ||||
| 		} | ||||
| 		prompts := map[string]Prompt{ | ||||
| 			"password": { | ||||
| 				pattern:   `Password\s*for\s*'.+':`, | ||||
| 				canAskFor: true, | ||||
| 			}, | ||||
| 			"username": { | ||||
| 				pattern:   `Username\s*for\s*'.+':`, | ||||
| 				canAskFor: true, | ||||
| 			}, | ||||
| 		prompts := map[string]string{ | ||||
| 			"password": `Password\s*for\s*'.+':`, | ||||
| 			"username": `Username\s*for\s*'.+':`, | ||||
| 		} | ||||
|  | ||||
| 		for askFor, prompt := range prompts { | ||||
| 			if !prompt.canAskFor { | ||||
| 				continue | ||||
| 			} | ||||
| 			if match, _ := regexp.MatchString(prompt.pattern, ttyText); match { | ||||
| 				prompt.canAskFor = false | ||||
| 		for askFor, pattern := range prompts { | ||||
| 			if match, _ := regexp.MatchString(pattern, ttyText); match { | ||||
| 				ttyText = "" | ||||
| 				return ask(askFor) | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user