Skip to content

Commit e63ab10

Browse files
pass credentials to .RemoteRepositoryExists for GitHub
That doesn't fix the problem 100% (on my machine, running SCM Backup works. But Git Credentials Manager still keeps popping up while running the integration tests)
1 parent c9d19ac commit e63ab10

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/ScmBackup/Hosters/Github/GithubApi.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ public List<HosterRepository> GetRepositoryList(ConfigSource source)
104104
// We only want the repos under the user:
105105
var userRepos = repos.Where(r => r.Owner.Login == source.Name);
106106

107+
ScmCredentials credentials = null;
108+
if (source.IsAuthenticated)
109+
{
110+
credentials = new ScmCredentials(source.AuthName, source.Password);
111+
}
112+
107113
foreach (var apiRepo in userRepos)
108114
{
109115
var repo = new HosterRepository(apiRepo.FullName, apiRepo.Name, apiRepo.CloneUrl, ScmType.Git);
@@ -117,7 +123,7 @@ public List<HosterRepository> GetRepositoryList(ConfigSource source)
117123

118124
// issue #13: the GitHub API only returns whether it's *possible* to create a wiki, but not if the repo actually *has* a wiki.
119125
// So we need to skip the wiki when the URL (which we just built manually) is not a valid repository.
120-
if (scm.RemoteRepositoryExists(wikiUrl))
126+
if (scm.RemoteRepositoryExists(wikiUrl, credentials))
121127
{
122128
repo.SetWiki(true, wikiUrl);
123129
}

0 commit comments

Comments
 (0)