mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 09:15:26 +01:00 
			
		
		
		
	Fix Login Detection By Repo Param (#151)
Fix login detection by Repo param Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/151 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		| @@ -25,3 +25,15 @@ func RepoForWorkdir() (*TeaRepo, error) { | ||||
|  | ||||
| 	return &TeaRepo{repo}, nil | ||||
| } | ||||
|  | ||||
| // RepoFromPath tries to open the git repository by path | ||||
| func RepoFromPath(path string) (*TeaRepo, error) { | ||||
| 	repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{ | ||||
| 		DetectDotGit: true, | ||||
| 	}) | ||||
| 	if err != nil { | ||||
| 		return nil, err | ||||
| 	} | ||||
|  | ||||
| 	return &TeaRepo{repo}, nil | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 6543
					6543