Merge "repo: Repo does not always handle '.' parameter correctly"
diff --git a/command.py b/command.py
index bc2f950..2ff0a34 100644
--- a/command.py
+++ b/command.py
@@ -119,6 +119,11 @@
         except KeyError:
           oldpath = path
           path = os.path.dirname(path)
+      if not project and path == manifest.topdir:
+        try:
+          project = self._by_path[path]
+        except KeyError:
+          pass
     else:
       try:
         project = self._by_path[path]
diff --git a/project.py b/project.py
index c91085c..918ee09 100644
--- a/project.py
+++ b/project.py
@@ -628,7 +628,7 @@
     self.gitdir = gitdir.replace('\\', '/')
     self.objdir = objdir.replace('\\', '/')
     if worktree:
-      self.worktree = worktree.replace('\\', '/')
+      self.worktree = os.path.normpath(worktree.replace('\\', '/'))
     else:
       self.worktree = None
     self.relpath = relpath