UNPKG

4.59 kBJavaScriptView Raw
1"use strict";
2
3var cov_270ou9i6pi = function () {
4 var path = "/home/travis/build/commitizen/cz-cli/src/commitizen/staging.js";
5 var hash = "f47101f60ab6c7dca389fc1f0eed484161a1b996";
6 var global = new Function("return this")();
7 var gcv = "__coverage__";
8 var coverageData = {
9 path: "/home/travis/build/commitizen/cz-cli/src/commitizen/staging.js",
10 statementMap: {
11 "0": {
12 start: {
13 line: 9,
14 column: 2
15 },
16 end: {
17 line: 18,
18 column: 5
19 }
20 },
21 "1": {
22 start: {
23 line: 13,
24 column: 4
25 },
26 end: {
27 line: 15,
28 column: 5
29 }
30 },
31 "2": {
32 start: {
33 line: 14,
34 column: 6
35 },
36 end: {
37 line: 14,
38 column: 25
39 }
40 },
41 "3": {
42 start: {
43 line: 16,
44 column: 17
45 },
46 end: {
47 line: 16,
48 column: 29
49 }
50 },
51 "4": {
52 start: {
53 line: 17,
54 column: 4
55 },
56 end: {
57 line: 17,
58 column: 43
59 }
60 }
61 },
62 fnMap: {
63 "0": {
64 name: "isClean",
65 decl: {
66 start: {
67 line: 8,
68 column: 9
69 },
70 end: {
71 line: 8,
72 column: 16
73 }
74 },
75 loc: {
76 start: {
77 line: 8,
78 column: 34
79 },
80 end: {
81 line: 19,
82 column: 1
83 }
84 },
85 line: 8
86 },
87 "1": {
88 name: "(anonymous_1)",
89 decl: {
90 start: {
91 line: 12,
92 column: 5
93 },
94 end: {
95 line: 12,
96 column: 6
97 }
98 },
99 loc: {
100 start: {
101 line: 12,
102 column: 30
103 },
104 end: {
105 line: 18,
106 column: 3
107 }
108 },
109 line: 12
110 }
111 },
112 branchMap: {
113 "0": {
114 loc: {
115 start: {
116 line: 13,
117 column: 4
118 },
119 end: {
120 line: 15,
121 column: 5
122 }
123 },
124 type: "if",
125 locations: [{
126 start: {
127 line: 13,
128 column: 4
129 },
130 end: {
131 line: 15,
132 column: 5
133 }
134 }, {
135 start: {
136 line: 13,
137 column: 4
138 },
139 end: {
140 line: 15,
141 column: 5
142 }
143 }],
144 line: 13
145 },
146 "1": {
147 loc: {
148 start: {
149 line: 16,
150 column: 17
151 },
152 end: {
153 line: 16,
154 column: 29
155 }
156 },
157 type: "binary-expr",
158 locations: [{
159 start: {
160 line: 16,
161 column: 17
162 },
163 end: {
164 line: 16,
165 column: 23
166 }
167 }, {
168 start: {
169 line: 16,
170 column: 27
171 },
172 end: {
173 line: 16,
174 column: 29
175 }
176 }],
177 line: 16
178 }
179 },
180 s: {
181 "0": 0,
182 "1": 0,
183 "2": 0,
184 "3": 0,
185 "4": 0
186 },
187 f: {
188 "0": 0,
189 "1": 0
190 },
191 b: {
192 "0": [0, 0],
193 "1": [0, 0]
194 },
195 _coverageSchema: "43e27e138ebf9cfc5966b082cf9a028302ed4184",
196 hash: "f47101f60ab6c7dca389fc1f0eed484161a1b996"
197 };
198 var coverage = global[gcv] || (global[gcv] = {});
199
200 if (coverage[path] && coverage[path].hash === hash) {
201 return coverage[path];
202 }
203
204 return coverage[path] = coverageData;
205}();
206
207Object.defineProperty(exports, "__esModule", {
208 value: true
209});
210exports.isClean = isClean;
211
212var _child_process = require("child_process");
213
214/**
215 * Asynchrounously determines if the staging area is clean
216 */
217function isClean(repoPath, done) {
218 cov_270ou9i6pi.f[0]++;
219 cov_270ou9i6pi.s[0]++;
220 (0, _child_process.exec)('git diff --no-ext-diff --name-only && git diff --no-ext-diff --cached --name-only', {
221 maxBuffer: Infinity,
222 cwd: repoPath
223 }, function (error, stdout) {
224 cov_270ou9i6pi.f[1]++;
225 cov_270ou9i6pi.s[1]++;
226
227 if (error) {
228 cov_270ou9i6pi.b[0][0]++;
229 cov_270ou9i6pi.s[2]++;
230 return done(error);
231 } else {
232 cov_270ou9i6pi.b[0][1]++;
233 }
234
235 let output = (cov_270ou9i6pi.s[3]++, (cov_270ou9i6pi.b[1][0]++, stdout) || (cov_270ou9i6pi.b[1][1]++, ''));
236 cov_270ou9i6pi.s[4]++;
237 done(null, output.trim().length === 0);
238 });
239}
\No newline at end of file