Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Support for clone without checkout (git clone -n) #721

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

rykov
Copy link
Contributor

@rykov rykov commented Jan 17, 2018

Based on #705 issue discussion about supporting git clone -n option that doesn't checkout HEAD after cloning a remote repository. This follows documented git-clone behavior of ignoring --recurse-submodules when no-checkout option is enabled:

This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given)

src: https://git-scm.com/docs/git-clone#git-clone---recurse-submodulesltpathspec

@@ -448,6 +448,24 @@ func (s *RepositorySuite) TestPlainCloneWithRecurseSubmodules(c *C) {
c.Assert(cfg.Submodules, HasLen, 2)
}

func (s *RepositorySuite) TestPlainCloneNoCheckout(c *C) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we ensure that HEAD is pointing to the commit should be pointing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcuadros Take a look now - I've added a HEAD check

@rykov rykov force-pushed the clone-no-checkout branch from 0a4e812 to 591aed1 Compare January 17, 2018 09:45
@mcuadros mcuadros merged commit f6aca08 into src-d:master Jan 18, 2018
@rykov rykov deleted the clone-no-checkout branch January 18, 2018 14:12
@rykov
Copy link
Contributor Author

rykov commented Jan 21, 2018

@mcuadros When you get a chance, can you please tag this into a release?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants