Commits

Victor Garcia  committed fd10712

Fix paths ending in doubleslashes.

  • Participants
  • Parent commits 1486ff3

Comments (0)

Files changed (2)

File bitbucket_hook/hook.py

 
     else:
         common_prefix = os.path.commonprefix(common_prefix)
-        if common_prefix:
+        if common_prefix and not common_prefix.endswith('/'):
             common_prefix += '/'
 
     if listfiles:

File bitbucket_hook/test/test_hook.py

     nocommonplusslash = distinct + [d(file='path4/dir/')]
     commonplusslash = shared + [d(file='path/dir/')]
 
+    pypydoubleslash = [d(file='pypy/jit/metainterp/opt/u.py'),
+                       d(file='pypy/jit/metainterp/test/test_c.py'),
+                       d(file='pypy/jit/metainterp/test/test_o.py')]
     nothing = ('', '')
     files_expected = [([], nothing),
                       ([empty], nothing),
                       (commonplusempty, nothing),
                       (nocommonplusslash, nothing),
                       (commonplusslash, ('path/', '')),
+                      (pypydoubleslash, ('pypy/jit/metainterp/', '')),
                       ]
 
     for f, wanted in files_expected:
                       (commonplusempty, ('',' M(file1, file2, file)')),
                       (nocommonplusslash, ('',' M(file1, file2, file)')),
                       (commonplusslash, ('path/',' M(file1, file2, file)')),
+                      (pypydoubleslash, ('pypy/jit/metainterp/',
+                                         ' M(u.py, test_c.py, test_o.py)')),
                       ]
 
     for f, wanted in files_expected: