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

Function defaultRebaseOptions

lib/rebase.js:11–83  ·  view source on GitHub ↗
(options, checkoutStrategy)

Source from the content-addressed store, hash-verified

9var _commit = Rebase.prototype.commit;
10
11function defaultRebaseOptions(options, checkoutStrategy) {
12 let checkoutOptions;
13 let mergeOptions;
14
15 if (options) {
16 options = shallowClone(options);
17 checkoutOptions = options.checkoutOptions;
18 mergeOptions = options.mergeOptions;
19 delete options.checkoutOptions;
20 delete options.mergeOptions;
21
22 if (options.signingCb) {
23 let signingCb = options.signingCb;
24 options.signingCb = function (
25 signatureBuf,
26 signatureFieldBuf,
27 commitContent
28 ) {
29 try {
30 const signingCbResult = signingCb(commitContent);
31
32 return Promise.resolve(signingCbResult)
33 .then(function({ code, field, signedData }) {
34 if (code === NodeGit.Error.CODE.OK) {
35 signatureBuf.setString(signedData);
36 if (field) {
37 signatureFieldBuf.setString(field);
38 }
39 }
40
41 return code;
42 })
43 .catch(function(error) {
44 if (error && error.code) {
45 return error.code;
46 }
47 return NodeGit.Error.CODE.ERROR;
48 });
49 } catch (error) {
50 if (error && error.code) {
51 return error.code;
52 }
53 return NodeGit.Error.CODE.ERROR;
54 }
55 };
56 }
57
58 options = normalizeOptions(options, NodeGit.RebaseOptions);
59 } else {
60 options = normalizeOptions({}, NodeGit.RebaseOptions);
61 if (checkoutStrategy) {
62 checkoutOptions = {
63 checkoutStrategy: checkoutStrategy
64 };
65 }
66 }
67
68 if (checkoutOptions) {

Callers 1

rebase.jsFile · 0.85

Calls 2

shallowCloneFunction · 0.85
normalizeOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…