Changeset - 078136fd83fb
[Not reviewed]
default
0 2 0
domruf - 10 years ago 2016-04-11 22:36:52
dominikruf@gmail.com
tests: fix Git on Windows sometimes failing on ' or ` in file:/// URLs

Some Git versions will fail when cloning a repository like:

git clone file:///path/to/strange-file-'`foobar myclone

Since '` (and some other characters) are filtered anyway (in
lib.utils.repo_name_slug) I think this test doesn't need to test those
characters.
2 files changed with 5 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/compare.py
Show inline comments
 
@@ -130,6 +130,7 @@ class CompareController(BaseRepoControll
 
                else:
 
                    # no changesets from other repo, ancestor is the other_rev
 
                    ancestor = other_rev
 

	
 
                # dulwich 0.9.9 doesn't have a Repo.close() so we have to mess with internals:
 
                gitrepo.object_store.close()
 
                gitrepo_remote.object_store.close()
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -46,7 +46,8 @@ class GitRepositoryTest(unittest.TestCas
 
        # Verify correct quoting of evil characters that should work on posix file systems
 
        if sys.platform == 'win32':
 
            # windows does not allow '"' in dir names
 
            tricky_path = get_new_dir("tricky-path-repo-$'`")
 
            # and some versions of the git client don't like ` and '
 
            tricky_path = get_new_dir("tricky-path-repo-$")
 
        else:
 
            tricky_path = get_new_dir("tricky-path-repo-$'\"`")
 
        successfully_cloned = GitRepository(tricky_path, src_url=TEST_GIT_REPO, update_after_clone=True, create=True)
 
@@ -55,7 +56,8 @@ class GitRepositoryTest(unittest.TestCas
 

	
 
        if sys.platform == 'win32':
 
            # windows does not allow '"' in dir names
 
            tricky_path_2 = get_new_dir("tricky-path-2-repo-$'`")
 
            # and some versions of the git client don't like ` and '
 
            tricky_path_2 = get_new_dir("tricky-path-2-repo-$")
 
        else:
 
            tricky_path_2 = get_new_dir("tricky-path-2-repo-$'\"`")
 
        successfully_cloned2 = GitRepository(tricky_path_2, src_url=tricky_path, bare=True, create=True)
0 comments (0 inline, 0 general)