nebius/SWE-bench-extra huggingface dataset:
Repository: stopthatcow/zazu

Issue:
Fix github SCM to list private repos
Right now github SCM class returns only public repos for the logged-in user. This should also return private repos.

Comments:

Patch:
diff --git a/zazu/plugins/github_scm_host.py b/zazu/plugins/github_scm_host.py
index 27b0d13..e7b6126 100644
--- a/zazu/plugins/github_scm_host.py
+++ b/zazu/plugins/github_scm_host.py
@@ -23,7 +23,6 @@ class ScmHost(zazu.scm_host.ScmHost):
 
         """
         self._github_handle = None
-        self._user = user
         self._url = url
 
     def connect(self):
@@ -38,7 +37,7 @@ class ScmHost(zazu.scm_host.ScmHost):
     def repos(self):
         """List repos available to this user."""
         try:
-            for r in self._github().get_user(self._user).get_repos():
+            for r in self._github().get_user().get_repos():
                 yield GitHubScmRepoAdaptor(r)
         except github.GithubException as e:
             raise zazu.scm_host.ScmHostError(str(e))


Test patch:
diff --git a/tests/test_github_scm_host.py b/tests/test_github_scm_host.py
index 5c91ee3..dd005e0 100644
--- a/tests/test_github_scm_host.py
+++ b/tests/test_github_scm_host.py
@@ -32,7 +32,7 @@ def test_github_scm_host_get_repos(mocker, scm_host_mock):
     mocker.patch('zazu.github_helper.make_gh', return_value=github_mock)
     scm_host_mock.connect()
     repos = list(scm_host_mock.repos())
-    github_mock.get_user.assert_called_once_with('stopthatcow')
+    github_mock.get_user.assert_called_once_with()
     user_mock.get_repos.assert_called_once()
     assert len(repos) == 1
     assert repos[0].name == 'zazu'
@@ -54,7 +54,6 @@ def test_from_config(git_repo):
     with zazu.util.cd(git_repo.working_tree_dir):
         uut = zazu.plugins.github_scm_host.ScmHost.from_config({'user': 'stopthatcow',
                                                                 'type': 'github'})
-        assert uut._user == 'stopthatcow'
         assert uut.type() == 'github'