nestlabs / nlbuild-autotools

The Nest Labs Build - GNU Autotools (nlbuild-autotools) provides a customized, turnkey build system framework, based on GNU autotools, for standalone Nest Labs (or other) software packages that need to support not only building on and targeting against standalone build host systems but also embedded target systems using GCC-based or -compatible toolchains.
Apache License 2.0
4 stars 12 forks source link

clean-repos: Don't delete submodules from index with "clone" method #67

Closed mspang closed 4 years ago

mspang commented 4 years ago

With pull.method == clone, nlbuild-autotools doesn't require a git repo in the parent project. So don't run git commands there.

This fixes an incompatibility between the clone method and submodules where cleaning will leave staged deletions in the index.

gerickson commented 4 years ago

This seems to be a regression of desired functionality: post-patch, if I run make -f Makefile-bootstrap clean-repos, the repos present in repos.conf are still in the working tree.

mspang commented 4 years ago

What if we check if there's a submodule ptr at that path, and only leave the empty directory in that case?

mspang commented 4 years ago

Git will put an empty directory at a submodule and if it's missing, the tree is considered dirty. It doesn't really do any harm.