Skip to content
Snippets Groups Projects
Select Git revision
  • c82b9afb364826f78b0817fc136295097e7815a4
  • main default protected
  • next
  • renovate/main-lock-file-maintenance
  • renovate/main-lint-staged-16.x
  • renovate/main-redis-5.x
  • chore/update-static-data
  • feat/gnupg
  • fix/36615b-branch-reuse-no-cache
  • chore/punycode
  • refactor/pin-new-value
  • feat/36219--git-x509-signing
  • feat/structured-logger
  • hotfix/39.264.1
  • feat/skip-dangling
  • gh-readonly-queue/next/pr-36034-7a061c4ca1024a19e2c295d773d9642625d1c2be
  • hotfix/39.238.3
  • refactor/gitlab-auto-approve
  • feat/template-strings
  • gh-readonly-queue/next/pr-35654-137d934242c784e0c45d4b957362214f0eade1d7
  • fix/32307-global-extends-merging
  • 41.61.1
  • 41.61.0
  • 41.60.4
  • 41.60.3
  • 41.60.2
  • 41.60.1
  • 41.60.0
  • 41.59.2
  • 41.59.1
  • 41.59.0
  • 41.58.2
  • 41.58.1
  • 41.58.0
  • 41.57.1
  • 41.57.0
  • 41.56.1
  • 41.56.0
  • 41.55.3
  • 41.55.2
  • 41.55.1
41 results

config.ts

Blame
  • config.ts 991 B
    import is from '@sindresorhus/is';
    import type { SimpleGitOptions } from 'simple-git';
    import { GlobalConfig } from '../../config/global';
    import type { GitNoVerifyOption } from './types';
    
    let noVerify: GitNoVerifyOption[] = ['push', 'commit'];
    
    export function setNoVerify(value: GitNoVerifyOption[]): void {
      // istanbul ignore if
      if (!is.array(value, is.string)) {
        throw new Error('config error: gitNoVerify should be an array of strings');
      }
      noVerify = value;
    }
    
    export function getNoVerify(): GitNoVerifyOption[] {
      return noVerify;
    }
    
    export function simpleGitConfig(): Partial<SimpleGitOptions> {
      const config: Partial<SimpleGitOptions> = {
        completion: {
          onClose: true,
          onExit: false,
        },
        config: ['core.quotePath=false'],
      };
      // https://github.com/steveukx/git-js/pull/591
      const gitTimeout = GlobalConfig.get('gitTimeout');
      if (is.number(gitTimeout) && gitTimeout > 0) {
        config.timeout = { block: gitTimeout };
      }
      return config;
    }