remote-bzr: fix directory renaming
[gitweb.git] / contrib / remote-helpers / git-remote-bzr
index c5822e4ac97ed3640c81cb645509346489199379..a7d041baeccab8d976f2237586f5e35ff6ada40c 100755 (executable)
@@ -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