This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git


The following commit(s) were added to refs/heads/master by this push:
     new 1771d4e  Don't default to shallow clone for 'new' command
1771d4e is described below

commit 1771d4e2584b38c598e7e033aa033b7e155dfad7
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Aug 2 09:51:30 2022 +0200

    Don't default to shallow clone for 'new' command
    
    Release tag may no longer be on top of master branch and shallow
    copy would result if checkout fail.
---
 newt/cli/project_cmds.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/newt/cli/project_cmds.go b/newt/cli/project_cmds.go
index 290a04c..6dc07d6 100644
--- a/newt/cli/project_cmds.go
+++ b/newt/cli/project_cmds.go
@@ -60,6 +60,14 @@ func newRunCmd(cmd *cobra.Command, args []string) {
        }
        defer os.RemoveAll(tmpdir)
 
+       /* For new command don't use shallow copy by default
+        * as release tag may not be present on tip of master
+        * branch.
+        */
+       if util.ShallowCloneDepth < 0 {
+               util.ShallowCloneDepth = 0;
+       }
+
        if err := dl.Clone("master", tmpdir); err != nil {
                NewtUsage(nil, err)
        }

Reply via email to