diff --git a/contrib/remote-helpers/git-remote-bzr b/contrib/remote-helpers/git-remote-bzr index c5822e4ac97ed3640c81cb645509346489199379..a7d041baeccab8d976f2237586f5e35ff6ada40c 100755 --- a/contrib/remote-helpers/git-remote-bzr +++ b/contrib/remote-helpers/git-remote-bzr @@ -191,7 +191,13 @@ def get_filechanges(cur, prev): modified[path] = fid for oldpath, newpath, fid, kind, mod, _ in changes.renamed: removed[oldpath] = None - modified[newpath] = fid + if kind == 'directory': + lst = cur.list_files(from_dir=newpath, recursive=True) + for path, file_class, kind, fid, entry in lst: + if kind != 'directory': + modified[newpath + '/' + path] = fid + else: + modified[newpath] = fid return modified, removed diff --git a/contrib/remote-helpers/test-bzr.sh b/contrib/remote-helpers/test-bzr.sh index 70aa8a010a6bc00a131860f2db509e56a7f75797..f0672f618de6aae1f47d73b0b696d84e5177e6cf 100755 --- a/contrib/remote-helpers/test-bzr.sh +++ b/contrib/remote-helpers/test-bzr.sh @@ -140,4 +140,28 @@ test_expect_success 'special modes' ' test_cmp expected actual ' +cat > expected < movedir/one && + echo two > movedir/two && + bzr add movedir && + bzr commit -m movedir && + bzr mv movedir movedir-new && + bzr commit -m movedir-new) && + + (cd gitrepo && + git pull && + git ls-tree HEAD > ../actual) && + + test_cmp expected actual +' + test_done