# Cloning of submodule with --depth should follow the branch option

1 messages from 2015-11-02 to 2015-11-02. Participants: Mikhail Zabaluev.
Thread: https://gitlist.dev/t/40705

## Mikhail Zabaluev, 2015-11-02 07:55

Subject: Cloning of submodule with --depth should follow the branch option
Message-ID: <CAKUkx92jfjti4WGmeOHdXi2uCGTu0AifL23NzKCWg7n1vJZDmg@mail.gmail.com>
URL: https://gitlist.dev/e/CAKUkx92jfjti4WGmeOHdXi2uCGTu0AifL23NzKCWg7n1vJZDmg%40mail.gmail.com

```
Hi,

I have an issue with git 2.4.3 when trying to limit the amount of data
fetched when cloning submodules. The --depth option is useful, but
when .gitmodules specifies a non-default branch, the submodule
repository clone invocation (which is a single-branch clone due to
--depth) fetches master regardless, and then checkout fails due to a
nonexistent tree reference. I think it would be sensible in this case
to pass --branch to the submodule clone command.

Here's a repository to exercise: https://github.com/gi-rust/gir

Best regards,
  Mikhail

```
