Skip to content

cmd/go: get -u fails with git submodules #7764

@gopherbot

Description

@gopherbot

by daniel.fanjul.alcuten:

What does 'go version' print?
go version go1.2.1 linux/amd64
It happens also with go 1.2.

What steps reproduce the problem?
1. Create a git non-bare repository.
2. Create a git submodule on that repository with some go code.
3. Make GOPATH point to that git submodule
4. Run 'go get -u' to update the git submodule

What happened?
It fails with the error:
package <project>: directory "<absolute path of the project>" is
not using a known version control system

What should have happened instead?
It should have detected the git repository of the submodule and successfully updated it.

Please provide any additional information below.

It is probably because the submodule has a .git file that is not a folder:
$ cat $GOPATH/src/<project>/.git
gitdir: <superproject>/.git/modules/<submodule path>

It works after replacing the file .git by a proper fully-fledged folder.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions