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/lib/remote.js DELETED
@@ -1,270 +0,0 @@
1
- var util = require("util");
2
- var NodeGit = require("../");
3
- var normalizeFetchOptions = NodeGit.Utils.normalizeFetchOptions;
4
- var normalizeOptions = NodeGit.Utils.normalizeOptions;
5
- var lookupWrapper = NodeGit.Utils.lookupWrapper;
6
- var shallowClone = NodeGit.Utils.shallowClone;
7
-
8
- var Remote = NodeGit.Remote;
9
- var _connect = Remote.prototype.connect;
10
- var _createWithOpts = Remote.createWithOpts;
11
- var _disconnect = Remote.prototype.disconnect;
12
- var _download = Remote.prototype.download;
13
- var _fetch = Remote.prototype.fetch;
14
- var _push = Remote.prototype.push;
15
- var _updateTips = Remote.prototype.updateTips;
16
- var _upload = Remote.prototype.upload;
17
-
18
- /**
19
- * Retrieves the remote by name
20
- * @async
21
- * @param {Repository} repo The repo that the remote lives in
22
- * @param {String|Remote} name The remote to lookup
23
- * @param {Function} callback
24
- * @return {Remote}
25
- */
26
- Remote.lookup = lookupWrapper(Remote);
27
-
28
- /**
29
- * Connects to a remote
30
- *
31
- * @async
32
- * @param {Enums.DIRECTION} direction The direction for the connection
33
- * @param {RemoteCallbacks} callbacks The callback functions for the connection
34
- * @param {ProxyOptions} proxyOpts Proxy settings
35
- * @param {Array<string>} customHeaders extra HTTP headers to use
36
- * @param {Function} callback
37
- * @return {Number} error code
38
- */
39
- Remote.prototype.connect = function(
40
- direction,
41
- callbacks,
42
- proxyOpts,
43
- customHeaders
44
- ) {
45
- callbacks = normalizeOptions(callbacks || {}, NodeGit.RemoteCallbacks);
46
- proxyOpts = normalizeOptions(proxyOpts || {}, NodeGit.ProxyOptions);
47
- customHeaders = customHeaders || [];
48
-
49
- return _connect.call(this, direction, callbacks, proxyOpts, customHeaders)
50
- .then(() => {
51
- // Save options on the remote object. If we don't do this,
52
- // the options may be cleaned up and cause a segfault
53
- // when Remote.prototype.connect is called.
54
- Object.defineProperties(this, {
55
- callbacks: {
56
- configurable: true,
57
- value: callbacks,
58
- writable: false
59
- },
60
- proxyOpts: {
61
- configurable: true,
62
- value: proxyOpts,
63
- writable: false
64
- },
65
- customHeaders: {
66
- configurable: true,
67
- value: customHeaders,
68
- writable: false
69
- }
70
- });
71
- });
72
- };
73
-
74
- Remote.createWithOpts = function(url, options) {
75
- return _createWithOpts(url, normalizeOptions(
76
- options, NodeGit.RemoteCreateOptions));
77
- };
78
-
79
- Remote.prototype.disconnect = function() {
80
- return _disconnect.call(this)
81
- .then(() => {
82
- // Release the options
83
- Object.defineProperties(this, {
84
- callbacks: {
85
- configurable: true,
86
- value: undefined,
87
- writable: false
88
- },
89
- proxyOpts: {
90
- configurable: true,
91
- value: undefined,
92
- writable: false
93
- },
94
- customHeaders: {
95
- configurable: true,
96
- value: undefined,
97
- writable: false
98
- }
99
- });
100
- });
101
- };
102
-
103
- /**
104
- * Connects to a remote
105
- *
106
- * @async
107
- * @param {Array} refSpecs The ref specs that should be pushed
108
- * @param {FetchOptions} opts The fetch options for download, contains callbacks
109
- * @param {Function} callback
110
- * @return {Number} error code
111
- */
112
- Remote.prototype.download = function(refspecs, opts) {
113
- return _download
114
- .call(this, refspecs, normalizeFetchOptions(opts));
115
- };
116
-
117
- /**
118
- * Connects to a remote
119
- *
120
- * @async
121
- * @param {Array} refSpecs The ref specs that should be pushed
122
- * @param {FetchOptions} opts The fetch options for download, contains callbacks
123
- * @param {String} message The message to use for the update reflog messages
124
- * @param {Function} callback
125
- * @return {Number} error code
126
- */
127
- Remote.prototype.fetch = function(refspecs, opts, reflog_message) {
128
- return _fetch
129
- .call(this, refspecs, normalizeFetchOptions(opts), reflog_message);
130
- };
131
-
132
- /**
133
- * Pushes to a remote
134
- *
135
- * @async
136
- * @param {Array} refSpecs The ref specs that should be pushed
137
- * @param {PushOptions} options Options for the checkout
138
- * @param {Function} callback
139
- * @return {Number} error code
140
- */
141
- Remote.prototype.push = function(refSpecs, opts) {
142
- var callbacks;
143
- var proxyOpts;
144
-
145
- if (opts) {
146
- opts = shallowClone(opts);
147
- callbacks = opts.callbacks;
148
- proxyOpts = opts.proxyOpts;
149
- delete opts.callbacks;
150
- delete opts.proxyOpts;
151
- } else {
152
- opts = {};
153
- }
154
-
155
- opts = normalizeOptions(opts, NodeGit.PushOptions);
156
-
157
- if (callbacks) {
158
- opts.callbacks =
159
- normalizeOptions(callbacks, NodeGit.RemoteCallbacks);
160
- }
161
-
162
- if (proxyOpts) {
163
- opts.proxyOpts =
164
- normalizeOptions(proxyOpts, NodeGit.ProxyOptions);
165
- }
166
-
167
- return _push.call(this, refSpecs, opts);
168
- };
169
-
170
- /**
171
- * Lists advertised references from a remote. You must connect to the remote
172
- * before using referenceList.
173
- *
174
- * @async
175
- * @return {Promise<Array<RemoteHead>>} a list of the remote heads the remote
176
- * had available at the last established
177
- * connection.
178
- *
179
- */
180
- Remote.prototype.referenceList = Remote.prototype.referenceList;
181
-
182
- /**
183
- * Update the tips to the new state
184
- * @param {RemoteCallbacks} callbacks The callback functions for the connection
185
- * @param {boolean} updateFetchhead whether to write to FETCH_HEAD. Pass true
186
- * to behave like git.
187
- * @param {boolean} downloadTags what the behaviour for downloading tags is
188
- * for this fetch. This is ignored for push.
189
- * This must be the same value passed to
190
- * Remote.prototype.download
191
- * @param {string} reflogMessage The message to insert into the reflogs. If
192
- * null and fetching, the default is "fetch ",
193
- * where is the name of the remote (or its url,
194
- * for in-memory remotes). This parameter is
195
- * ignored when pushing.
196
- */
197
- Remote.prototype.updateTips = function(
198
- callbacks,
199
- updateFetchhead,
200
- downloadTags,
201
- reflogMessage
202
- ) {
203
- if (callbacks) {
204
- callbacks = normalizeOptions(callbacks, NodeGit.RemoteCallbacks);
205
- }
206
-
207
- return _updateTips.call(
208
- this,
209
- callbacks,
210
- updateFetchhead,
211
- downloadTags,
212
- reflogMessage
213
- );
214
- };
215
-
216
- /**
217
- * Pushes to a remote
218
- *
219
- * @async
220
- * @param {Array} refSpecs The ref specs that should be pushed
221
- * @param {PushOptions} options Options for the checkout
222
- * @param {Function} callback
223
- * @return {Number} error code
224
- */
225
- Remote.prototype.upload = function(refSpecs, opts) {
226
- var callbacks;
227
- var proxyOpts;
228
-
229
- if (opts) {
230
- opts = shallowClone(opts);
231
- callbacks = opts.callbacks;
232
- proxyOpts = opts.proxyOpts;
233
- delete opts.callbacks;
234
- delete opts.proxyOpts;
235
- } else {
236
- opts = {};
237
- }
238
-
239
- opts = normalizeOptions(opts, NodeGit.PushOptions);
240
-
241
- if (callbacks) {
242
- opts.callbacks =
243
- normalizeOptions(callbacks, NodeGit.RemoteCallbacks);
244
- }
245
-
246
- if (proxyOpts) {
247
- opts.proxyOpts =
248
- normalizeOptions(proxyOpts, NodeGit.ProxyOptions);
249
- }
250
-
251
- return _upload.call(this, refSpecs, opts);
252
- };
253
-
254
- NodeGit.Remote.COMPLETION_TYPE = {};
255
- var DEPRECATED_STATES = {
256
- COMPLETION_DOWNLOAD: "DOWNLOAD",
257
- COMPLETION_INDEXING: "INDEXING",
258
- COMPLETION_ERROR: "ERROR"
259
- };
260
-
261
- Object.keys(DEPRECATED_STATES).forEach((key) => {
262
- const newKey = DEPRECATED_STATES[key];
263
- Object.defineProperty(NodeGit.Remote.COMPLETION_TYPE, key, {
264
- get: util.deprecate(
265
- () => NodeGit.Remote.COMPLETION[newKey],
266
- `Use NodeGit.Remote.COMPLETION.${newKey} instead of ` +
267
- `NodeGit.Remote.COMPLETION_TYPE.${key}.`
268
- )
269
- });
270
- });