Skip to content

Commit f7c7c60

Browse files
committed
Explicitly disable interactive go on Windows
1 parent 705c145 commit f7c7c60

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ only_special_branches: &only_special_branches
297297
filters:
298298
branches:
299299
only:
300-
- "/.*(ci|dependabot.pip|deploy|dry.run|hotfix|publish|release|windows).*/"
300+
- "/.*(ci|dependabot.pip|deploy|dry.run|hotfix|macos|publish|release|windows).*/"
301301
- "develop"
302302
- "master"
303303

git_machete/client/go_interactive.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import sys
2-
import termios
3-
import tty
42
from typing import List, Optional, Tuple
53

4+
try:
5+
import termios
6+
import tty
7+
except ImportError:
8+
# termios and tty are not available on Windows
9+
termios = None # type: ignore[assignment]
10+
tty = None # type: ignore[assignment]
11+
612
from git_machete import utils
713
from git_machete.client.base import MacheteClient
14+
from git_machete.exceptions import UnexpectedMacheteException
815
from git_machete.git_operations import LocalBranchShortName
916
from git_machete.utils import AnsiEscapeCodes, bold, index_or_none, warn
1017

@@ -124,6 +131,9 @@ def go_interactive(self) -> Optional[LocalBranchShortName]:
124131
Launch interactive branch selection interface.
125132
Returns the selected branch or None if cancelled.
126133
"""
134+
if termios is None or tty is None:
135+
raise UnexpectedMacheteException("Interactive mode is not supported on Windows yet")
136+
127137
# Get flat list of branches with depths from already-parsed state
128138
self._managed_branches_with_depths = self._get_branch_list_with_depths()
129139

tests/test_go_interactive.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def read_line_from_fd(fd: int, timeout: float = 2.0) -> str:
8888
return ''
8989

9090

91+
@pytest.mark.skipif(sys.platform == 'win32', reason="Interactive mode is not supported on Windows")
9192
class TestGoInteractive(BaseTest):
9293
def setup_method(self) -> None:
9394
"""Set up a standard 4-branch repository for each test."""

0 commit comments

Comments
 (0)