mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-22 00:19:24 +03:00
We don't need to add another param here, actually
This commit is contained in:
parent
9d4e9cab5b
commit
04b4be16aa
@ -162,13 +162,12 @@ export default class GitRepositoryAsync {
|
||||
relativizeToWorkingDirectory (_path) {
|
||||
return this.getRepo()
|
||||
.then((repo) => {
|
||||
const workingDirectory = repo.workdir()
|
||||
let openedWorkingDirectory = null
|
||||
let workingDirectory = repo.workdir()
|
||||
const opened = this.openedPath.replace(/\/\.git$/, '')
|
||||
if (path.relative(opened, workingDirectory) !== '') {
|
||||
openedWorkingDirectory = opened
|
||||
workingDirectory = opened
|
||||
}
|
||||
return this.relativize(_path, workingDirectory, openedWorkingDirectory)
|
||||
return this.relativize(_path, workingDirectory)
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -179,7 +178,7 @@ export default class GitRepositoryAsync {
|
||||
// * `workingDirectory` The {String} working directory path.
|
||||
//
|
||||
// Returns the relative {String} path.
|
||||
relativize (_path, workingDirectory, openedWorkingDirectory) {
|
||||
relativize (_path, workingDirectory) {
|
||||
// The original implementation also handled null workingDirectory as it
|
||||
// pulled it from a sync function that could return null. We require it
|
||||
// to be passed here.
|
||||
@ -191,9 +190,6 @@ export default class GitRepositoryAsync {
|
||||
// prefix. Standardize by stripping that out.
|
||||
_path = _path.replace(/^\/private\//, '/')
|
||||
workingDirectory = workingDirectory.replace(/^\/private\//, '/')
|
||||
if (openedWorkingDirectory) {
|
||||
openedWorkingDirectory = openedWorkingDirectory.replace(/^\/private\//, '/')
|
||||
}
|
||||
|
||||
if (process.platform === 'win32') {
|
||||
_path = _path.replace(/\\/g, '/')
|
||||
@ -203,10 +199,6 @@ export default class GitRepositoryAsync {
|
||||
}
|
||||
}
|
||||
|
||||
if (openedWorkingDirectory) {
|
||||
workingDirectory = openedWorkingDirectory
|
||||
}
|
||||
|
||||
workingDirectory = workingDirectory.replace(/\/$/, '')
|
||||
|
||||
const originalPath = _path
|
||||
|
Loading…
Reference in New Issue
Block a user