A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/isomorphic-git/isomorphic-git/commit/7b04575a58ee99e15a0ecbaabacb8e13c7967c30 below:

remove the 'autoTranslateSSH' feature (#1006) · isomorphic-git/isomorphic-git@7b04575 · GitHub

File tree Expand file treeCollapse file tree 8 files changed

+26

-82

lines changed

Filter options

Expand file treeCollapse file tree 8 files changed

+26

-82

lines changed Original file line number Diff line number Diff line change

@@ -50,7 +50,7 @@ At the time of writing, the following breaking changes are planned:

50 50

- [x] The `signing` function argument of `log` will be removed, and `log` will simply always return a payload. **Update: Actually, it now returns the same kind of objects as `readCommit` because that just makes a lot of sense.** (This change is to simplify the type signature of `log` so we don't need function overloading; it is the only thing blocking me from abandoning the hand-crafted `index.d.ts` file and generating the TypeScript definitions directly from the JSDoc tags that already power the website docs.)

51 51

- [ ] Any functions that currently return `Buffer` objects will instead return `Uint8Array` so we can eventually drop the bloated Buffer browser polyfill.

52 52

- [x] The `pattern` and globbing options will be removed from `statusMatrix` so we can drop the dependencies on `globalyzer` and `globrex`, but you'll be able to bring your own `filter` function instead.

53 -

- [ ] The `autoTranslateSSH` feature will be removed, since it's trivial to implement using just the `UnknownTransportError.data.suggestion`

53 +

- [x] The `autoTranslateSSH` feature will be removed, since it's trivial to implement using just the `UnknownTransportError.data.suggestion`

54 54 55 55

## Getting Started

56 56 Original file line number Diff line number Diff line change

@@ -81,7 +81,7 @@ describe('fetch', () => {

81 81

value: `http://${localhost}:9999`

82 82

})

83 83

// Test

84 -

let err = null

84 +

let err

85 85

try {

86 86

await fetch({

87 87

gitdir,

@@ -97,50 +97,31 @@ describe('fetch', () => {

97 97

expect(err.code).toEqual(E.UnknownTransportError)

98 98

})

99 99 100 -

it('shallow fetch using autoTranslateSSH param (from Github)', async () => {

101 -

const { fs, gitdir } = await makeFixture('test-fetch-cors')

102 -

await config({

103 -

gitdir,

104 -

path: 'http.corsProxy',

105 -

value: `http://${localhost}:9999`

106 -

})

107 -

// Test

108 -

await fetch({

109 -

gitdir,

110 -

depth: 1,

111 -

singleBranch: true,

112 -

remote: 'ssh',

113 -

ref: 'test-branch-shallow-clone',

114 -

autoTranslateSSH: true

115 -

})

116 -

expect(await fs.exists(`${gitdir}/shallow`)).toBe(true)

117 -

const shallow = (await fs.read(`${gitdir}/shallow`)).toString('utf8')

118 -

expect(shallow === '92e7b4123fbf135f5ffa9b6fe2ec78d07bbc353e\n').toBe(true)

119 -

})

120 - 121 -

it('shallow fetch using autoTranslateSSH config (from Github)', async () => {

122 -

const { fs, gitdir } = await makeFixture('test-fetch-cors')

100 +

it('the SSH -> HTTPS UnknownTransportError suggestion feature', async () => {

101 +

const { gitdir } = await makeFixture('test-fetch-cors')

123 102

await config({

124 103

gitdir,

125 104

path: 'http.corsProxy',

126 105

value: `http://${localhost}:9999`

127 106

})

128 -

await config({

129 -

gitdir,

130 -

path: 'isomorphic-git.autoTranslateSSH',

131 -

value: true

132 -

})

133 107

// Test

134 -

await fetch({

135 -

gitdir,

136 -

depth: 1,

137 -

singleBranch: true,

138 -

remote: 'ssh',

139 -

ref: 'test-branch-shallow-clone'

140 -

})

141 -

expect(await fs.exists(`${gitdir}/shallow`)).toBe(true)

142 -

const shallow = (await fs.read(`${gitdir}/shallow`)).toString('utf8')

143 -

expect(shallow === '92e7b4123fbf135f5ffa9b6fe2ec78d07bbc353e\n').toBe(true)

108 +

let err

109 +

try {

110 +

await fetch({

111 +

gitdir,

112 +

depth: 1,

113 +

singleBranch: true,

114 +

remote: 'ssh',

115 +

ref: 'test-branch-shallow-clone'

116 +

})

117 +

} catch (e) {

118 +

err = e

119 +

}

120 +

expect(err).toBeDefined()

121 +

expect(err.code).toBe(E.UnknownTransportError)

122 +

expect(err.data.suggestion).toBe(

123 +

'https://github.com/isomorphic-git/isomorphic-git.git'

124 +

)

144 125

})

145 126 146 127

it('shallow fetch since (from Github)', async () => {

Original file line number Diff line number Diff line change

@@ -39,7 +39,6 @@ import { init } from './init.js'

39 39

* @param {object} [args.headers = {}] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config

40 40

* @param {import('events').EventEmitter} [args.emitter] - [deprecated] Overrides the emitter set via the ['emitter' plugin](./plugin_emitter.md)

41 41

* @param {string} [args.emitterPrefix = ''] - Scope emitted events by prepending `emitterPrefix` to the event name

42 -

* @param {boolean} [args.autoTranslateSSH] - Attempt to automatically translate SSH remotes into HTTP equivalents

43 42

*

44 43

* @returns {Promise<void>} Resolves successfully when clone completes

45 44

*

@@ -84,7 +83,6 @@ export async function clone ({

84 83

newSubmoduleBehavior = false,

85 84

noTags = false,

86 85

headers = {},

87 -

autoTranslateSSH = false,

88 86

// @ts-ignore

89 87

onprogress

90 88

}) {

@@ -139,8 +137,7 @@ export async function clone ({

139 137

relative,

140 138

singleBranch,

141 139

headers,

142 -

tags: !noTags,

143 -

autoTranslateSSH

140 +

tags: !noTags

144 141

})

145 142

if (fetchHead === null) return

146 143

ref = ref || defaultBranch

Original file line number Diff line number Diff line change

@@ -17,7 +17,6 @@ import { join } from '../utils/join.js'

17 17

import { pkg } from '../utils/pkg.js'

18 18

import { cores } from '../utils/plugins.js'

19 19

import { splitLines } from '../utils/splitLines.js'

20 -

import { translateSSHtoHTTP } from '../utils/translateSSHtoHTTP.js'

21 20

import { parseUploadPackResponse } from '../wire/parseUploadPackResponse.js'

22 21

import { writeUploadPackRequest } from '../wire/writeUploadPackRequest.js'

23 22

@@ -64,7 +63,6 @@ import { config } from './config'

64 63

* @param {object} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config

65 64

* @param {boolean} [args.prune] - Delete local remote-tracking branches that are not present on the remote

66 65

* @param {boolean} [args.pruneTags] - Prune local tags that don’t exist on the remote, and force-update those tags that differ

67 -

* @param {boolean} [args.autoTranslateSSH] - Attempt to automatically translate SSH remotes into HTTP equivalents

68 66

* @param {import('events').EventEmitter} [args.emitter] - [deprecated] Overrides the emitter set via the ['emitter' plugin](./plugin_emitter.md).

69 67

* @param {string} [args.emitterPrefix = ''] - Scope emitted events by prepending `emitterPrefix` to the event name.

70 68

*

@@ -115,7 +113,6 @@ export async function fetch ({

115 113

headers = {},

116 114

prune = false,

117 115

pruneTags = false,

118 -

autoTranslateSSH = false,

119 116

// @ts-ignore

120 117

onprogress // deprecated

121 118

}) {

@@ -150,8 +147,7 @@ export async function fetch ({

150 147

singleBranch,

151 148

headers,

152 149

prune,

153 -

pruneTags,

154 -

autoTranslateSSH

150 +

pruneTags

155 151

})

156 152

if (response === null) {

157 153

return {

@@ -242,8 +238,7 @@ async function fetchPackfile ({

242 238

singleBranch,

243 239

headers,

244 240

prune,

245 -

pruneTags,

246 -

autoTranslateSSH

241 +

pruneTags

247 242

}) {

248 243

const fs = new FileSystem(_fs)

249 244

// Sanity checks

@@ -263,14 +258,6 @@ async function fetchPackfile ({

263 258

})

264 259

}

265 260 266 -

// Try to convert SSH URLs to HTTPS ones

267 -

if (

268 -

autoTranslateSSH ||

269 -

(await config({ fs, gitdir, path: `isomorphic-git.autoTranslateSSH` }))

270 -

) {

271 -

url = translateSSHtoHTTP(url)

272 -

}

273 - 274 261

if (corsProxy === undefined) {

275 262

corsProxy = await config({ fs, gitdir, path: 'http.corsProxy' })

276 263

}

Original file line number Diff line number Diff line change

@@ -35,7 +35,6 @@ import { merge } from './merge'

35 35

* @param {Object} [args.author] - passed to [commit](commit.md) when creating a merge commit

36 36

* @param {Object} [args.committer] - passed to [commit](commit.md) when creating a merge commit

37 37

* @param {string} [args.signingKey] - passed to [commit](commit.md) when creating a merge commit

38 -

* @param {boolean} [args.autoTranslateSSH] - Attempt to automatically translate SSH remotes into HTTP equivalents

39 38

* @param {boolean} [args.noSubmodules = false] - If true, will not print out an error about missing submodules support. TODO: Skip checkout out submodules when supported instead.

40 39

* @param {boolean} [args.newSubmoduleBehavior = false] - If true, will opt into a newer behavior that improves submodule non-support by at least not accidentally deleting them.

41 40

*

@@ -74,7 +73,6 @@ export async function pull ({

74 73

author,

75 74

committer,

76 75

signingKey,

77 -

autoTranslateSSH = false,

78 76

noSubmodules = false,

79 77

newSubmoduleBehavior = false

80 78

}) {

@@ -105,8 +103,7 @@ export async function pull ({

105 103

token,

106 104

oauth2format,

107 105

singleBranch,

108 -

headers,

109 -

autoTranslateSSH

106 +

headers

110 107

})

111 108

// Merge the remote tracking branch into the local one.

112 109

await merge({

Original file line number Diff line number Diff line change

@@ -10,7 +10,6 @@ import { join } from '../utils/join.js'

10 10

import { pkg } from '../utils/pkg.js'

11 11

import { cores } from '../utils/plugins.js'

12 12

import { splitLines } from '../utils/splitLines.js'

13 -

import { translateSSHtoHTTP } from '../utils/translateSSHtoHTTP.js'

14 13

import { parseReceivePackResponse } from '../wire/parseReceivePackResponse.js'

15 14

import { writeReceivePackRequest } from '../wire/writeReceivePackRequest.js'

16 15

@@ -63,7 +62,6 @@ import { pack } from './pack.js'

63 62

* @param {string} [args.token] - See the [Authentication](./authentication.html) documentation

64 63

* @param {string} [args.oauth2format] - See the [Authentication](./authentication.html) documentation

65 64

* @param {object} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config

66 -

* @param {boolean} [args.autoTranslateSSH] - Attempt to automatically translate SSH remotes into HTTP equivalents

67 65

* @param {import('events').EventEmitter} [args.emitter] - [deprecated] Overrides the emitter set via the ['emitter' plugin](./plugin_emitter.md).

68 66

* @param {string} [args.emitterPrefix = ''] - Scope emitted events by prepending `emitterPrefix` to the event name.

69 67

*

@@ -103,8 +101,7 @@ export async function push ({

103 101

password = authPassword,

104 102

token,

105 103

oauth2format,

106 -

headers = {},

107 -

autoTranslateSSH = false

104 +

headers = {}

108 105

}) {

109 106

try {

110 107

const fs = new FileSystem(_fs)

@@ -113,14 +110,6 @@ export async function push ({

113 110

url = await config({ fs, gitdir, path: `remote.${remote}.url` })

114 111

}

115 112 116 -

// Try to convert SSH URLs to HTTPS ones

117 -

if (

118 -

autoTranslateSSH ||

119 -

(await config({ fs, gitdir, path: `isomorphic-git.autoTranslateSSH` }))

120 -

) {

121 -

url = translateSSHtoHTTP(url)

122 -

}

123 - 124 113

if (corsProxy === undefined) {

125 114

corsProxy = await config({ fs, gitdir, path: 'http.corsProxy' })

126 115

}

Original file line number Diff line number Diff line change

@@ -399,7 +399,6 @@ export function clone(args: WorkDir & GitDir & {

399 399

noGitSuffix?: boolean;

400 400

noTags?: boolean;

401 401

headers?: { [key: string]: string };

402 -

autoTranslateSSH?: boolean;

403 402

}): Promise<void>;

404 403 405 404

export function commit(args: GitDir & {

@@ -501,7 +500,6 @@ export function fetch(args: GitDir & {

501 500

prune?: boolean;

502 501

pruneTags?: boolean;

503 502

headers?: { [key: string]: string };

504 -

autoTranslateSSH?: boolean;

505 503

}): Promise<FetchResponse>;

506 504 507 505

export function findRoot(args: {

@@ -631,7 +629,6 @@ export function pull(args: WorkDir & GitDir & {

631 629

headers?: { [key: string]: string };

632 630

emitter?: EventEmitter;

633 631

emitterPrefix?: string;

634 -

autoTranslateSSH?: boolean;

635 632

author?: {

636 633

name?: string;

637 634

email?: string;

@@ -668,7 +665,6 @@ export function push(args: GitDir & {

668 665

headers?: { [key: string]: string };

669 666

emitter?: EventEmitter;

670 667

emitterPrefix?: string;

671 -

autoTranslateSSH?: boolean;

672 668

}): Promise<PushResponse>;

673 669 674 670

export function readBlob(args: GitDir & {

Original file line number Diff line number Diff line change

@@ -26,9 +26,6 @@ const schema = {

26 26

symlinks: bool,

27 27

ignorecase: bool,

28 28

bigFileThreshold: num

29 -

},

30 -

'isomorphic-git': {

31 -

autoTranslateSSH: bool

32 29

}

33 30

}

34 31

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4