mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Merge pull request #11606 from atom/fix-infinite-recursion
Fix infinite recursion in GitRepositoryAsync
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
"marked": "^0.3.4",
|
||||
"normalize-package-data": "^2.0.0",
|
||||
"nslog": "^3",
|
||||
"ohnogit": "0.0.9",
|
||||
"ohnogit": "0.0.11",
|
||||
"oniguruma": "^5",
|
||||
"pathwatcher": "~6.2",
|
||||
"property-accessors": "^1.1.3",
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
logallrefupdates = true
|
||||
ignorecase = true
|
||||
precomposeunicode = true
|
||||
[branch "master"]
|
||||
remote = origin
|
||||
merge = refs/heads/master
|
||||
[remote "origin"]
|
||||
url = git@github.com:atom/some-repo-i-guess.git
|
||||
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||
[submodule "jstips"]
|
||||
url = https://github.com/loverajoel/jstips
|
||||
[submodule "You-Dont-Need-jQuery"]
|
||||
|
||||
1
spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master
vendored
Normal file
1
spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master
vendored
Normal file
@@ -0,0 +1 @@
|
||||
d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5
|
||||
@@ -877,4 +877,34 @@ describe('GitRepositoryAsync', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getOriginURL()', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copyRepository('repo-with-submodules')
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
})
|
||||
|
||||
it('returns the origin URL', async () => {
|
||||
const url = await repo.getOriginURL()
|
||||
expect(url).toBe('git@github.com:atom/some-repo-i-guess.git')
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getUpstreamBranch()', () => {
|
||||
it('returns null when there is no upstream branch', async () => {
|
||||
const workingDirectory = copyRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
|
||||
const upstream = await repo.getUpstreamBranch()
|
||||
expect(upstream).toBe(null)
|
||||
})
|
||||
|
||||
it('returns the upstream branch', async () => {
|
||||
const workingDirectory = copyRepository('repo-with-submodules')
|
||||
repo = GitRepositoryAsync.open(workingDirectory)
|
||||
|
||||
const upstream = await repo.getUpstreamBranch()
|
||||
expect(upstream).toBe('refs/remotes/origin/master')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -234,7 +234,7 @@ export default class GitRepositoryAsync {
|
||||
// Returns a {Promise} which resolves to the {String} origin url of the
|
||||
// repository.
|
||||
getOriginURL (_path) {
|
||||
return this.repo.getOriginalURL(_path)
|
||||
return this.repo.getOriginURL(_path)
|
||||
}
|
||||
|
||||
// Public: Returns the upstream branch for the current HEAD, or null if there
|
||||
@@ -246,7 +246,7 @@ export default class GitRepositoryAsync {
|
||||
// Returns a {Promise} which resolves to a {String} branch name such as
|
||||
// `refs/remotes/origin/master`.
|
||||
getUpstreamBranch (_path) {
|
||||
return this.getUpstreamBranch(_path)
|
||||
return this.repo.getUpstreamBranch(_path)
|
||||
}
|
||||
|
||||
// Public: Gets all the local and remote references.
|
||||
|
||||
Reference in New Issue
Block a user