Merge pull request #629 from pre-commit/more_realistic_test_clones · precommit/pre-commit@3a7806e · GitHub
Skip to content

Commit 3a7806e

Browse files
authored
Merge pull request pre-commit#629 from pre-commit/more_realistic_test_clones
Use file:// protocol for cloning under test
2 parents e76bc17 + 989bcfe commit 3a7806e

4 files changed

Lines changed: 7 additions & 3 deletions

File tree

pre_commit/languages/golang.py

Lines changed: 4 additions & 1 deletion

testing/fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def config_with_local_hooks():
8383
def make_config_from_repo(repo_path, sha=None, hooks=None, check=True):
8484
manifest = load_manifest(os.path.join(repo_path, C.MANIFEST_FILE))
8585
config = OrderedDict((
86-
('repo', repo_path),
86+
('repo', 'file://{}'.format(repo_path)),
8787
('sha', sha or get_head_sha(repo_path)),
8888
(
8989
'hooks',

tests/languages/golang_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
('url', 'expected'),
1111
(
1212
('/im/a/path/on/disk', 'unknown_src_dir'),
13+
('file:///im/a/path/on/disk', 'unknown_src_dir'),
1314
('git@github.com:golang/lint', 'github.com/golang/lint'),
1415
('git://github.com/golang/lint', 'github.com/golang/lint'),
1516
('http://github.com/golang/lint', 'github.com/golang/lint'),

tests/repository_test.py

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)