diff --git a/repo2docker/contentproviders/git.py b/repo2docker/contentproviders/git.py index 1427bd09..905fa4ee 100644 --- a/repo2docker/contentproviders/git.py +++ b/repo2docker/contentproviders/git.py @@ -45,10 +45,10 @@ class Git(ContentProvider): self.log.error( f"Failed to check out ref {ref}", extra=dict(phase=R2dState.FAILED) ) - if ref == "main": + if ref == "master" or ref == "main": msg = ( - "Failed to check out the 'main' branch. " - "Maybe the default branch is not named 'main' " + f"Failed to check out the '{ref}' branch. " + f"Maybe the default branch is not named '{ref}' " "for this repository.\n\nTry not explicitly " "specifying `--ref`." ) diff --git a/tests/external/reproductions.repos.yaml b/tests/external/reproductions.repos.yaml index d019bc10..74f1085c 100644 --- a/tests/external/reproductions.repos.yaml +++ b/tests/external/reproductions.repos.yaml @@ -12,12 +12,12 @@ # Test that a full remote/ref works - name: Binder Examples - Requirements url: https://github.com/binder-examples/requirements - ref: origin/master + ref: origin/main verify: python -c 'import matplotlib' # Test that ref is added to branch if not present - name: Binder Examples - Requirements url: https://github.com/binder-examples/requirements - ref: master + ref: main verify: python -c 'import matplotlib' # Test that tags work + ref is added to tag if not present - name: Binder Examples - Requirements