# HG changeset patch # User domruf # Date 1520786198 -3600 # Node ID 48f7c2aed3b7fc6e7243c76cc73e03af1d41bd51 # Parent a8d8100f14e516a7b6b43ac4bc8973c8d9f06cd5 git: fix links to nodes that are submodule links Without this changeset, a link pointing to ./ would generate a '500 Internal Server Error'. Instead, redirect requests to submodule paths to the target URL. diff -r a8d8100f14e5 -r 48f7c2aed3b7 kallithea/controllers/files.py --- a/kallithea/controllers/files.py Mon Nov 20 23:18:38 2017 +0100 +++ b/kallithea/controllers/files.py Sun Mar 11 17:36:38 2018 +0100 @@ -165,7 +165,9 @@ 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 -r a8d8100f14e5 -r 48f7c2aed3b7 kallithea/tests/other/test_vcs_operations.py --- a/kallithea/tests/other/test_vcs_operations.py Mon Nov 20 23:18:38 2017 +0100 +++ b/kallithea/tests/other/test_vcs_operations.py Sun Mar 11 17:36:38 2018 +0100 @@ -695,4 +695,5 @@ repo_name=fork_name, revision='tip', f_path='/testsubmodule'), - status=500) # BUG + status=302) + assert response.location == clone_url