Changeset - 48f7c2aed3b7
[Not reviewed]
default
0 2 0
domruf - 8 years ago 2018-03-11 17:36:38
dominikruf@gmail.com
Grafted from: 35f75876280c
git: fix links to nodes that are submodule links

Without this changeset, a link pointing to ./<submodulename> would generate a
'500 Internal Server Error'.

Instead, redirect requests to submodule paths to the target URL.
2 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/files.py
Show inline comments
 
@@ -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
kallithea/tests/other/test_vcs_operations.py
Show inline comments
 
@@ -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
0 comments (0 inline, 0 general)