Skip to content

[build]: custom:dev breaks at repo cloning, for some branch names - simple-git bug #1321

@nbogie

Description

@nbogie

Most appropriate sections of the p5.js website?

Other (specify if possible)

What is your operating system?

Mac OS

Web browser and version

n/a

Actual Behavior

running custom:dev fails during attempted cloning, with certain branches but not others.

suspected due to this bug in simple-git: simple-git 3.32.0 mistakenly recognizes any clone option with u as unsafe

Example:

Note the branch name has a u in it, somewhere after a -

npm run custom:dev git@github.com:nbogie/p5.js.git#nb-remove-requires-jsdoc

Log

Considering cloning repo: git@github.com:nbogie/p5.js.git branch: nb-remove-requires-jsdoc into path: /omitted/p5.js-website/src/scripts/parsers/in/p5.js
Preparing to clone repository...
Cloning repository ...
Error cloning repo: Error: Use of clone with option -u is not permitted without enabling allowUnsafePack
/omitted/p5.js-website/node_modules/simple-git/src/lib/plugins/block-unsafe-operations-plugin.ts:45
      throw new GitPluginError(
            ^

GitPluginError: Use of clone with option -u is not permitted without enabling allowUnsafePack
    at preventUploadPack (/omitted/p5.js-website/node_modules/simple-git/src/lib/plugins/block-unsafe-operations-plugin.ts:45:13)
...
    at GitExecutorChain.attemptTask (/omitted/p5.js-website/node_modules/simple-git/src/lib/runners/git-executor-chain.ts:63:20) {
  task: {
    commands: [
      'clone',
      '--depth',
      '1',
      '--filter=blob:none',
      '--branch',
      'nb-remove-requires-jsdoc',
      'git@github.com:nbogie/p5.js.git',
      '/omitted/p5.js-website/src/scripts/parsers/in/p5.js'
    ],
    format: 'utf-8',
    parser: [Function: parser]
  },
  plugin: 'unsafe'
}

### Expected Behavior

Should be able to use custom:dev to clone any regular branch name consisting of alphanumeric and dashes.

### Steps to reproduce

1. run
```bash
npm run custom:dev git@github.com:nbogie/p5.js.git#nb-remove-requires-jsdoc

or recreate with a local branch of the same name.

Would you like to work on the issue?

yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions