Skip to content

Commit 4984eb3

Browse files
committed
Revert "dulwich: workaround for codespaces system config"
This reverts commit 8b40388.
1 parent ff22b4f commit 4984eb3

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/scmrepo/git/backend/dulwich/__init__.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -285,32 +285,10 @@ def commit(self, msg: str, no_verify: bool = False):
285285
try:
286286
commit(self.root_dir, message=msg, no_verify=no_verify)
287287
except InvalidUserIdentity as exc:
288-
identity = self._get_codespaces_identity()
289-
if identity is not None:
290-
commit(
291-
self.root_dir,
292-
message=msg,
293-
no_verify=no_verify,
294-
committer=identity,
295-
author=identity,
296-
)
297-
else:
298-
raise SCMError("Git username and email must be configured") from exc
288+
raise SCMError("Git username and email must be configured") from exc
299289
except TimezoneFormatError as exc:
300290
raise SCMError("Invalid Git timestamp") from exc
301291

302-
def _get_codespaces_identity(self) -> Optional[bytes]:
303-
from dulwich.config import ConfigFile, StackedConfig
304-
from dulwich.repo import get_user_identity
305-
306-
if "CODESPACES" not in os.environ:
307-
return None
308-
try:
309-
config = StackedConfig([ConfigFile.from_path("/usr/local/etc/gitconfig")])
310-
return get_user_identity(config)
311-
except Exception: # pylint: disable=broad-except
312-
return None
313-
314292
def checkout(
315293
self,
316294
branch: str,

0 commit comments

Comments
 (0)