esrlabs / git-repo

repo - The multiple repository tool (also works on MS Windows!)
https://code.google.com/p/git-repo/
Apache License 2.0
436 stars 145 forks source link

Error: project not found when try to create new branch in specified project #65

Open panidarynka opened 7 years ago

panidarynka commented 7 years ago

Hello, I successfully installed your git-repo for Windows. Then init repo with manifest and synced my projects. When trying to create a new branch with: $ repo start branch_name project_name I have an error: project project_name not found. But command: $ repo start branch_name --all works fine. Why doesn't repo tool see my projects?

hassin23ayz commented 6 years ago

try :

$repo start branchName --all

Xkhi commented 6 years ago

I have the same issue, the thing here is I don't want to create a branch in all projects

Joeskaife commented 6 years ago

in .repo/repo/command.py update the following functions to add backslash substitution:

  def _ResetPathToProjectMap(self, projects):
    self._by_path = dict((p.worktree.replace('\\', '/'), p) for p in projects)

  def _UpdatePathToProjectMap(self, project):
    self._by_path[project.worktree.replace('\\', '/')] = project

This is needed because rather inconsistently the manifest has the backslashes substituted already in the original version so when the project name is compared with the manifest it fails.

I wonder if someone maintaining this GIT could fix this for everyone?