Skip to content

Commit d55e4a3

Browse files
committed
Use git plumbing command to fix test
1 parent 73282e4 commit d55e4a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/clone_test.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,9 @@ def test_clones_all_branches_true(file_config):
108108
# initially we should not see multiple branches
109109
branch_out = subprocess.check_output((
110110
'git', '-C', str(file_config.output_dir.join('repo1')),
111-
'branch', '--remote',
111+
'for-each-ref', 'refs/remotes', "--format='%(refname:strip=2)'",
112112
)).decode()
113-
assert branch_out == ' origin/main\n'
113+
assert branch_out == "'origin/HEAD'\n'origin/main'\n"
114114

115115
# set that we want to clone all branches
116116
cfg_contents = json.loads(file_config.cfg.read())
@@ -121,9 +121,9 @@ def test_clones_all_branches_true(file_config):
121121

122122
branch_out = subprocess.check_output((
123123
'git', '-C', str(file_config.output_dir.join('repo1')),
124-
'branch', '--remote',
124+
'for-each-ref', 'refs/remotes', "--format='%(refname:strip=2)'",
125125
)).decode()
126-
assert branch_out == ' origin/b2\n origin/main\n'
126+
assert branch_out == "'origin/HEAD'\n'origin/b2'\n'origin/main'\n"
127127

128128

129129
def test_it_sorts_filtered_repos(file_config):

0 commit comments

Comments
 (0)