New issue
Advanced search Search tips

Issue 880516 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

gclient should verify it's in the correct repository before overwriting origin URL

Project Member Reported by michae...@chromium.org, Sep 4

Issue description

Occasionally, `gclient sync` changes my top-level repository's "origin" URL to point to some other project. This causes substantial problems.

I believe this is the same problem explained here: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/ok-TRleTRUo

> After investigation, it turned out that they had an old third-party repository that had been removed lying in their tree for a long time (i.e. they did not remove when "gclient sync" recommended).

> Then, if they try to move back in the past, at a point were the repository exists and "gclient sync", a "git remote set-url" is run in the third-party repository location (as the directory exists), but it sets the main repository origin because there was no .git directory in that third-party checkout anymore.

I hit this today by following these steps:

1. be on tip of tree
2. git checkout branch-heads/3538 && gclient sync # check out M70
3. git checkout branch-heads/3497 && gclient sync # check out M69

Expected: Everything is OK.
Actual: The URL for remote "origin" has been changed in .git/config to:
    https://chromium.googlesource.com/chromium/deps/mesa.git
    and my checkout is hosed
    (check with `git remote get-url origin`)

Presumably, this is because gclient goes into third_party/mesa (which exists but has no .git directory) and then runs `git remote set-url origin` with the dep's URL.
 
Components: -Infra Infra>SDK
Status: Available (was: Untriaged)

Sign in to add a comment