diff --git a/kallithea/controllers/files.py b/kallithea/controllers/files.py --- a/kallithea/controllers/files.py +++ b/kallithea/controllers/files.py @@ -165,7 +165,9 @@ class FilesController(BaseRepoController try: c.file = c.changeset.get_node(f_path) - if c.file.is_file(): + if c.file.is_submodule(): + raise HTTPFound(location=c.file.url) + elif c.file.is_file(): c.load_full_history = False # determine if we're on branch head _branches = c.db_repo_scm_instance.branches diff --git a/kallithea/tests/other/test_vcs_operations.py b/kallithea/tests/other/test_vcs_operations.py --- a/kallithea/tests/other/test_vcs_operations.py +++ b/kallithea/tests/other/test_vcs_operations.py @@ -695,4 +695,5 @@ class TestVCSOperations(TestController): repo_name=fork_name, revision='tip', f_path='/testsubmodule'), - status=500) # BUG + status=302) + assert response.location == clone_url