pj-nodegit 0.18.5 → 0.18.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/package.json +4 -5
  2. package/lib/README.md +0 -3
  3. package/lib/attr.js +0 -20
  4. package/lib/blame.js +0 -20
  5. package/lib/blob.js +0 -73
  6. package/lib/branch.js +0 -19
  7. package/lib/buf.js +0 -11
  8. package/lib/checkout.js +0 -51
  9. package/lib/cherrypick.js +0 -73
  10. package/lib/clone.js +0 -33
  11. package/lib/commit.js +0 -437
  12. package/lib/config.js +0 -25
  13. package/lib/convenient_hunks.js +0 -61
  14. package/lib/convenient_patch.js +0 -131
  15. package/lib/credential.js +0 -33
  16. package/lib/diff.js +0 -113
  17. package/lib/diff_file.js +0 -38
  18. package/lib/diff_line.js +0 -32
  19. package/lib/enums.js +0 -689
  20. package/lib/error.js +0 -17
  21. package/lib/filter_registry.js +0 -25
  22. package/lib/index.js +0 -103
  23. package/lib/libgit2.js +0 -6
  24. package/lib/merge.js +0 -72
  25. package/lib/nodegit.js +0 -1333
  26. package/lib/note.js +0 -17
  27. package/lib/object.js +0 -45
  28. package/lib/odb_object.js +0 -9
  29. package/lib/oid.js +0 -23
  30. package/lib/rebase.js +0 -142
  31. package/lib/reference.js +0 -213
  32. package/lib/remote.js +0 -270
  33. package/lib/repository.js +0 -1982
  34. package/lib/reset.js +0 -76
  35. package/lib/revert.js +0 -77
  36. package/lib/revwalk.js +0 -142
  37. package/lib/signature.js +0 -38
  38. package/lib/stash.js +0 -62
  39. package/lib/status.js +0 -18
  40. package/lib/status_file.js +0 -106
  41. package/lib/status_list.js +0 -12
  42. package/lib/submodule.js +0 -51
  43. package/lib/tag.js +0 -135
  44. package/lib/tree.js +0 -175
  45. package/lib/tree_entry.js +0 -99
  46. package/lib/utils/lookup_wrapper.js +0 -39
  47. package/lib/utils/normalize_fetch_options.js +0 -43
  48. package/lib/utils/normalize_options.js +0 -29
  49. package/lib/utils/shallow_clone.js +0 -14
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pj-nodegit",
3
3
  "description": "Node.js libgit2 asynchronous native bindings",
4
- "version": "0.18.5",
4
+ "version": "0.18.6",
5
5
  "homepage": "http://nodegit.org",
6
6
  "keywords": [
7
7
  "libgit2",
@@ -44,7 +44,7 @@
44
44
  "lodash": "^4.17.14",
45
45
  "nan": "^2.14.0",
46
46
  "node-gyp": "^8.4.1",
47
- "node-pre-gyp": "^0.17.0",
47
+ "@mapbox/node-pre-gyp": "^1.0.7",
48
48
  "ramda": "^0.25.0",
49
49
  "tar-fs": "^1.16.3"
50
50
  },
@@ -78,11 +78,10 @@
78
78
  "generateMissingTests": "node generate/scripts/generateMissingTests",
79
79
  "generateNativeCode": "node generate/scripts/generateNativeCode",
80
80
  "install": "node lifecycleScripts/preinstall && node lifecycleScripts/install",
81
- "installDebug": "BUILD_DEBUG=true npm run install",
82
- "lint": "jshint lib test/tests test/utils examples lifecycleScripts",
81
+ "installDebug": "BUILD_DEBUG=true npm install",
82
+ "lint": "jshint lib test/tests test/utils lifecycleScripts",
83
83
  "mergecov": "lcov-result-merger 'test/**/*.info' 'test/coverage/merged.lcov' && ./lcov-1.10/bin/genhtml test/coverage/merged.lcov --output-directory test/coverage/report",
84
84
  "mocha": "mocha --expose-gc test/runner test/tests --timeout 15000",
85
- "mergefile": "mocha test/mergefile",
86
85
  "mochaDebug": "mocha --expose-gc --debug-brk test/runner test/tests --timeout 15000",
87
86
  "postinstall": "node lifecycleScripts/postinstall",
88
87
  "prepublish": "npm run babel",
package/lib/README.md DELETED
@@ -1,3 +0,0 @@
1
- ## /lib
2
-
3
- Contains javascript extensions for the generated NodeGit modules. Any additional behavior on top of the standard libgit2 behavior will be found here.
package/lib/attr.js DELETED
@@ -1,20 +0,0 @@
1
- var util = require("util");
2
- var NodeGit = require("../");
3
-
4
- NodeGit.Attr.STATES = {};
5
- var DEPRECATED_STATES = {
6
- UNSPECIFIED_T: "UNSPECIFIED",
7
- TRUE_T: "TRUE",
8
- FALSE_T: "FALSE",
9
- VALUE_T: "STRING"
10
- };
11
-
12
- Object.keys(DEPRECATED_STATES).forEach((key) => {
13
- const newKey = DEPRECATED_STATES[key];
14
- Object.defineProperty(NodeGit.Attr.STATES, key, {
15
- get: util.deprecate(
16
- () => NodeGit.Attr.VALUE[newKey],
17
- `Use NodeGit.Attr.VALUE.${newKey} instead of NodeGit.Attr.STATES.${key}.`
18
- )
19
- });
20
- });
package/lib/blame.js DELETED
@@ -1,20 +0,0 @@
1
- var NodeGit = require("../");
2
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
3
- var Blame = NodeGit.Blame;
4
-
5
- var _file = Blame.file;
6
-
7
- /**
8
- * Retrieve the blame of a file
9
- *
10
- * @async
11
- * @param {Repository} repo that contains the file
12
- * @param {String} path to the file to get the blame of
13
- * @param {BlameOptions} [options] Options for the blame
14
- * @return {Blame} the blame
15
- */
16
- Blame.file = function(repo, path, options) {
17
- options = normalizeOptions(options, NodeGit.BlameOptions);
18
-
19
- return _file.call(this, repo, path, options);
20
- };
package/lib/blob.js DELETED
@@ -1,73 +0,0 @@
1
- var util = require("util");
2
- var NodeGit = require("../");
3
- var Blob = NodeGit.Blob;
4
- var LookupWrapper = NodeGit.Utils.lookupWrapper;
5
- var TreeEntry = NodeGit.TreeEntry;
6
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
7
-
8
- var _filteredContent = Blob.filteredContent;
9
- var _filter = Blob.prototype.filter;
10
-
11
- /**
12
- * Retrieves the blob pointed to by the oid
13
- * @async
14
- * @param {Repository} repo The repo that the blob lives in
15
- * @param {String|Oid|Blob} id The blob to lookup
16
- * @return {Blob}
17
- */
18
- Blob.lookup = LookupWrapper(Blob);
19
-
20
- /**
21
- * Retrieve the content of the Blob.
22
- *
23
- * @return {Buffer} Contents as a buffer.
24
- */
25
- Blob.prototype.content = function() {
26
- return this.rawcontent().toBuffer(this.rawsize());
27
- };
28
-
29
- /**
30
- * Retrieve the Blob's type.
31
- *
32
- * @return {Number} The filemode of the blob.
33
- */
34
- Blob.prototype.filemode = function() {
35
- var FileMode = TreeEntry.FILEMODE;
36
-
37
- return this.isBinary() ? FileMode.EXECUTABLE : FileMode.BLOB;
38
- };
39
-
40
- /**
41
- * Retrieve the Blob's content as String.
42
- *
43
- * @return {String} Contents as a string.
44
- */
45
- Blob.prototype.toString = function() {
46
- return this.content().toString();
47
- };
48
-
49
- /**
50
- * Get a buffer with the filtered content of a blob.
51
- *
52
- * This applies filters as if the blob was being checked out to the
53
- * working directory under the specified filename. This may apply
54
- * CRLF filtering or other types of changes depending on the file
55
- * attributes set for the blob and the content detected in it.
56
- *
57
- * @async
58
- * @param asPath Path used for file attribute lookups, etc.
59
- * @param opts Options to use for filtering the blob
60
- * @return {Promise<string>}
61
- */
62
- Blob.prototype.filter = function(asPath, opts) {
63
- if (opts) {
64
- opts = normalizeOptions(opts, NodeGit.BlobFilterOptions);
65
- }
66
- return _filter.call(this, asPath, opts);
67
- };
68
-
69
- Blob.filteredContent = util.deprecate(
70
- _filteredContent,
71
- "NodeGit.Blob.filteredContent is deprecated" +
72
- " use NodeGit.Blob.prototype.filter instead."
73
- );
package/lib/branch.js DELETED
@@ -1,19 +0,0 @@
1
- var NodeGit = require("../");
2
- var Branch = NodeGit.Branch;
3
-
4
- var _remoteName = Branch.remoteName;
5
-
6
- /**
7
- * Retrieve the Branch's Remote Name as a String.
8
- *
9
- * @async
10
- * @param {Repository} repo The repo to get the remote name from
11
- * @param {String} the refname of the branch
12
- * @return {String} remote name as a string.
13
- */
14
- Branch.remoteName = function(repo, remoteRef) {
15
- return _remoteName.call(this, repo, remoteRef)
16
- .then(function(remoteNameBuffer) {
17
- return remoteNameBuffer.toString();
18
- });
19
- };
package/lib/buf.js DELETED
@@ -1,11 +0,0 @@
1
- const { Buf } = require("../");
2
-
3
- /**
4
- * Sets the content of a GitBuf to a string.
5
- * @param {string} The utf8 value to set in the buffer.
6
- * The string will be null terminated.
7
- */
8
- Buf.prototype.setString = function(content) {
9
- const buf = Buffer.from(content + "\0", "utf8");
10
- this.set(buf, buf.length);
11
- };
package/lib/checkout.js DELETED
@@ -1,51 +0,0 @@
1
- var NodeGit = require("../");
2
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
3
-
4
- var Checkout = NodeGit.Checkout;
5
- var _head = Checkout.head;
6
- var _index = Checkout.index;
7
- var _tree = Checkout.tree;
8
-
9
- /**
10
- * Patch head checkout to automatically coerce objects.
11
- *
12
- * @async
13
- * @param {Repository} repo The repo to checkout head
14
- * @param {CheckoutOptions} [options] Options for the checkout
15
- * @return {Void} checkout complete
16
- */
17
- Checkout.head = function(url, options) {
18
- options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
19
-
20
- return _head.call(this, url, options);
21
- };
22
-
23
- /**
24
- * Patch index checkout to automatically coerce objects.
25
- *
26
- * @async
27
- * @param {Repository} repo The repo to checkout an index
28
- * @param {Index} index The index to checkout
29
- * @param {CheckoutOptions} [options] Options for the checkout
30
- * @return {Void} checkout complete
31
- */
32
- Checkout.index = function(repo, index, options) {
33
- options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
34
-
35
- return _index.call(this, repo, index, options);
36
- };
37
-
38
- /**
39
- * Patch tree checkout to automatically coerce objects.
40
- *
41
- * @async
42
- * @param {Repository} repo
43
- * @param {String|Tree|Commit|Reference} treeish
44
- * @param {CheckoutOptions} [options]
45
- * @return {Void} checkout complete
46
- */
47
- Checkout.tree = function(repo, treeish, options) {
48
- options = normalizeOptions(options || {}, NodeGit.CheckoutOptions);
49
-
50
- return _tree.call(this, repo, treeish, options);
51
- };
package/lib/cherrypick.js DELETED
@@ -1,73 +0,0 @@
1
- var NodeGit = require("../");
2
- var shallowClone = NodeGit.Utils.shallowClone;
3
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
4
-
5
- var Cherrypick = NodeGit.Cherrypick;
6
- var _cherrypick = Cherrypick.cherrypick;
7
- var _commit = Cherrypick.commit;
8
-
9
- /**
10
- * Cherrypick a commit and, changing the index and working directory
11
- *
12
- * @async
13
- * @param {Repository} repo The repo to checkout head
14
- * @param {Commit} commit The commit to cherrypick
15
- * @param {CherrypickOptions} [options] Options for the cherrypick
16
- * @return {int} 0 on success, -1 on failure
17
- */
18
- Cherrypick.cherrypick = function(repo, commit, options) {
19
- var mergeOpts;
20
- var checkoutOpts;
21
-
22
- if (options) {
23
- options = shallowClone(options);
24
- mergeOpts = options.mergeOpts;
25
- checkoutOpts = options.checkoutOpts;
26
- delete options.mergeOpts;
27
- delete options.checkoutOpts;
28
- }
29
-
30
- options = normalizeOptions(options, NodeGit.CherrypickOptions);
31
-
32
- if (mergeOpts) {
33
- options.mergeOpts =
34
- normalizeOptions(mergeOpts, NodeGit.MergeOptions);
35
- }
36
-
37
- if (checkoutOpts) {
38
- options.checkoutOpts =
39
- normalizeOptions(checkoutOpts, NodeGit.CheckoutOptions);
40
- }
41
-
42
- return _cherrypick.call(this, repo, commit, options);
43
- };
44
-
45
- /**
46
- * Cherrypicks the given commit against "our" commit, producing an index that
47
- * reflects the result of the cherrypick. The index is not backed by a repo.
48
- *
49
- * @async
50
- * @param {Repository} repo The repo to cherrypick commits
51
- * @param {Commit} cherrypick_commit The commit to cherrypick
52
- * @param {Commit} our_commit The commit to revert against
53
- * @param {int} mainline The parent of the revert commit (1 or
54
- * 2) if it's a merge, 0 otherwise
55
- * @param {MergeOptions} [merge_options] Merge options for the cherrypick
56
- * @return {int} 0 on success, -1 on failure
57
- */
58
- Cherrypick.commit = function(
59
- repo,
60
- cherrypick_commit,
61
- our_commit,
62
- mainline,
63
- merge_options) {
64
- merge_options = normalizeOptions(merge_options, NodeGit.MergeOptions);
65
-
66
- return _commit.call(
67
- this,
68
- repo,
69
- cherrypick_commit,
70
- our_commit,
71
- mainline,
72
- merge_options);
73
- };
package/lib/clone.js DELETED
@@ -1,33 +0,0 @@
1
- var NodeGit = require("../");
2
- var shallowClone = NodeGit.Utils.shallowClone;
3
- var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions;
4
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
5
-
6
- var Clone = NodeGit.Clone;
7
- var _clone = Clone.clone;
8
-
9
- /**
10
- * Patch repository cloning to automatically coerce objects.
11
- *
12
- * @async
13
- * @param {String} url url of the repository
14
- * @param {String} local_path local path to store repository
15
- * @param {CloneOptions} [options]
16
- * @return {Repository} repo
17
- */
18
- Clone.clone = function(url, local_path, options) {
19
- var fetchOpts = normalizeFetchOptions(options && options.fetchOpts);
20
-
21
- if (options) {
22
- options = shallowClone(options);
23
- delete options.fetchOpts;
24
- }
25
-
26
- options = normalizeOptions(options, NodeGit.CloneOptions);
27
-
28
- if (options) {
29
- options.fetchOpts = fetchOpts;
30
- }
31
-
32
- return _clone.call(this, url, local_path, options);
33
- };