@cmflow/cli 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmflow/cli",
3
- "version": "3.1.0",
3
+ "version": "3.1.2",
4
4
  "description": "An awesome Git Flow",
5
5
  "author": "camfou",
6
6
  "license": "MIT",
@@ -87,6 +87,7 @@ export function getConfig() {
87
87
  GIT_USER_EMAIL,
88
88
  GITLAB_USER_EMAIL,
89
89
  GITLAB_USER_NAME,
90
+ GIT_FETCH_MAX_DEPTH,
90
91
  JIRA_API,
91
92
  JIRA_EMAIL,
92
93
  JIRA_TOKEN,
@@ -137,6 +138,7 @@ export function getConfig() {
137
138
  REPOSITORY_URL: get(pkg, "repository.url", get(pkg, "repository", REPOSITORY_URL)),
138
139
  GIT_USER_NAME: GIT_USER_NAME || GITLAB_USER_NAME,
139
140
  GIT_USER_EMAIL: GIT_USER_EMAIL || GITLAB_USER_EMAIL,
141
+ GIT_FETCH_MAX_DEPTH,
140
142
  GIT_DISABLE_SSL,
141
143
  BUMP_METHOD,
142
144
  JIRA_API,
@@ -10,7 +10,7 @@ export function verifyConditions(pluginConfig, context) {
10
10
  context.config = getConfig();
11
11
  const {
12
12
  branch,
13
- config: { USER, EMAIL, ORIGIN }
13
+ config: { USER, EMAIL, ORIGIN, GIT_FETCH_MAX_DEPTH }
14
14
  } = context;
15
15
 
16
16
  if (USER && EMAIL) {
@@ -26,7 +26,14 @@ export function verifyConditions(pluginConfig, context) {
26
26
  process.exit(1);
27
27
  }
28
28
 
29
- git.fetch().sync();
29
+ if (GIT_FETCH_MAX_DEPTH !== "false") {
30
+ if (GIT_FETCH_MAX_DEPTH) {
31
+ git.fetch(`--depth=${GIT_FETCH_MAX_DEPTH}`).sync();
32
+ } else {
33
+ git.fetch().sync();
34
+ }
35
+ }
36
+
30
37
  git.checkout(branch.name).sync();
31
38
  git.branch(`--set-upstream-to=${ORIGIN}/${branch.name}`, branch.name).sync();
32
39
  }