MCPcopy Index your code
hub / github.com/nodegit/nodegit / getPromise

Function getPromise

lib/repository.js:243–309  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241 }
242
243 function getPromise() {
244 return rebase.next()
245 .then(function() {
246 return repository.refreshIndex();
247 })
248 .then(function(index) {
249 if (index.hasConflicts()) {
250 throw index;
251 }
252
253 return rebase.commit(null, signature);
254 })
255 .then(function() {
256
257 return performRebase(
258 repository,
259 rebase,
260 signature,
261 beforeNextFn,
262 beforeFinishFn
263 );
264 })
265 .catch(function(error) {
266 if (error && error.errno === NodeGit.Error.CODE.ITEROVER) {
267 const calcRewritten = fp.cond([
268 [fp.isEmpty, fp.constant(null)],
269 [fp.stubTrue, fp.flow([
270 fp.split("\n"),
271 fp.map(fp.split(" "))
272 ])]
273 ]);
274
275 const beforeFinishFnPromise = !beforeFinishFn ?
276 Promise.resolve() :
277 Promise.all([
278 readRebaseMetadataFile("onto_name"),
279 readRebaseMetadataFile("onto"),
280 readRebaseMetadataFile("head-name").then(calcHeadName),
281 readRebaseMetadataFile("orig-head"),
282 readRebaseMetadataFile("rewritten", true).then(calcRewritten)
283 ])
284 .then(function([
285 ontoName,
286 ontoSha,
287 originalHeadName,
288 originalHeadSha,
289 rewritten
290 ]) {
291 return beforeFinishFn({
292 ontoName,
293 ontoSha,
294 originalHeadName,
295 originalHeadSha,
296 rebase,
297 rewritten
298 });
299 });
300

Callers 1

performRebaseFunction · 0.85

Calls 2

performRebaseFunction · 0.85
readRebaseMetadataFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…