From fdb439be9c6c99da9c1edeb8d456487a4ccb9a0f Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 25 Apr 2016 17:09:07 -0400 Subject: [PATCH 01/13] Call through to the underlying repo. --- src/git-repository-async.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index 37131dd24..26840b822 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -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. From 8d26fe133aeaf9682027c36ed0736b75476020f7 Mon Sep 17 00:00:00 2001 From: joshaber Date: Mon, 25 Apr 2016 17:10:39 -0400 Subject: [PATCH 02/13] s/original/origin --- src/git-repository-async.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index 26840b822..b691994bc 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -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 From 891071196f35de2edfd3fd712937a90f0ceb427b Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Mon, 25 Apr 2016 15:28:22 -0700 Subject: [PATCH 03/13] Ensure atom.cmd with --wait returns exit code of 0 for git commit usage #11605 --- resources/win/atom.cmd | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/win/atom.cmd b/resources/win/atom.cmd index 8a4fed05c..73c4ddb01 100644 --- a/resources/win/atom.cmd +++ b/resources/win/atom.cmd @@ -27,6 +27,7 @@ IF "%EXPECT_OUTPUT%"=="YES" ( SET ELECTRON_ENABLE_LOGGING=YES IF "%WAIT%"=="YES" ( powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\atom.exe\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event" + exit 0 ) ELSE ( "%~dp0\..\..\atom.exe" %* ) From f589bdd8d9cd5d7b0d05c5ab5c4ccc55482a44d4 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:22:38 -0400 Subject: [PATCH 04/13] Add a remote to the fixture. --- spec/fixtures/git/repo-with-submodules/git.git/config | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/fixtures/git/repo-with-submodules/git.git/config b/spec/fixtures/git/repo-with-submodules/git.git/config index ab57cc5f1..209e37653 100644 --- a/spec/fixtures/git/repo-with-submodules/git.git/config +++ b/spec/fixtures/git/repo-with-submodules/git.git/config @@ -5,6 +5,9 @@ logallrefupdates = true ignorecase = true precomposeunicode = true +[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"] From f86a15e5fca34cee1351dbeeb5108719b6915282 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:22:56 -0400 Subject: [PATCH 05/13] Spec for getOriginURL --- spec/git-repository-async-spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index d36b9fd58..77ff1a4b5 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -877,4 +877,16 @@ 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') + }) + }) }) From ff43d917be636f486de059e07a02bd636180fb5b Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:23:54 -0400 Subject: [PATCH 06/13] Lower case --- spec/git-repository-async-spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index 77ff1a4b5..75f6848aa 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -885,8 +885,8 @@ describe('GitRepositoryAsync', () => { }) it('returns the origin URL', async () => { - const URL = await repo.getOriginURL() - expect(URL).toBe('git@github.com:atom/some-repo-i-guess.git') + const url = await repo.getOriginURL() + expect(url).toBe('git@github.com:atom/some-repo-i-guess.git') }) }) }) From 33a9240fe18ef01b5e223d9029da87e2f563c57f Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:45:56 -0400 Subject: [PATCH 07/13] :arrow_up: ohnogit@0.0.11 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 957d262f0..89a042915 100644 --- a/package.json +++ b/package.json @@ -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", From e16e987e08ba30f5853c8ab9428a061663304862 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:46:04 -0400 Subject: [PATCH 08/13] Give the fixture a remote --- spec/fixtures/git/repo-with-submodules/git.git/config | 3 +++ .../repo-with-submodules/git.git/refs/remotes/origin/master | 1 + 2 files changed, 4 insertions(+) create mode 100644 spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master diff --git a/spec/fixtures/git/repo-with-submodules/git.git/config b/spec/fixtures/git/repo-with-submodules/git.git/config index 209e37653..ff94b83d6 100644 --- a/spec/fixtures/git/repo-with-submodules/git.git/config +++ b/spec/fixtures/git/repo-with-submodules/git.git/config @@ -5,6 +5,9 @@ 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/* diff --git a/spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master b/spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master new file mode 100644 index 000000000..3507a23dc --- /dev/null +++ b/spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master @@ -0,0 +1 @@ +d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 From 67c7c60dcc874c22e86282a87bc302f1de06e7f0 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:49:03 -0400 Subject: [PATCH 09/13] Test getUpstreamBranch --- spec/git-repository-async-spec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index 75f6848aa..1fbe537d5 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -889,4 +889,22 @@ describe('GitRepositoryAsync', () => { 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') + }) + }) }) From 0541755ac8cf5f16792e081213234b5e868fbb84 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 09:49:38 -0400 Subject: [PATCH 10/13] Consistent indentation. --- spec/fixtures/git/repo-with-submodules/git.git/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/fixtures/git/repo-with-submodules/git.git/config b/spec/fixtures/git/repo-with-submodules/git.git/config index ff94b83d6..323ba7d9b 100644 --- a/spec/fixtures/git/repo-with-submodules/git.git/config +++ b/spec/fixtures/git/repo-with-submodules/git.git/config @@ -9,8 +9,8 @@ remote = origin merge = refs/heads/master [remote "origin"] - url = git@github.com:atom/some-repo-i-guess.git - fetch = +refs/heads/*:refs/remotes/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"] From e1c17ed8563b6ce0c20a65634c5a3f14d7539f3a Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 11:17:20 -0400 Subject: [PATCH 11/13] :arrow_up: status-bar@1.2.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 89a042915..627a411e1 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "settings-view": "0.235.1", "snippets": "1.0.2", "spell-check": "0.67.1", - "status-bar": "1.2.4", + "status-bar": "1.2.5", "styleguide": "0.45.2", "symbols-view": "0.112.0", "tabs": "0.93.1", From 53b7a20ad7e45960365b01d31f309be5f178b8cd Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 11:40:56 -0400 Subject: [PATCH 12/13] :arrow_up: status-bar@1.2.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 627a411e1..2874eaeb0 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "settings-view": "0.235.1", "snippets": "1.0.2", "spell-check": "0.67.1", - "status-bar": "1.2.5", + "status-bar": "1.2.6", "styleguide": "0.45.2", "symbols-view": "0.112.0", "tabs": "0.93.1", From 40d77613502f01b11c2ba36115acdab6aeb29080 Mon Sep 17 00:00:00 2001 From: joshaber Date: Tue, 26 Apr 2016 11:48:52 -0400 Subject: [PATCH 13/13] Bail if we don't have a grammar yet. --- src/workspace.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/workspace.coffee b/src/workspace.coffee index 7e67de97d..c8be01fef 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -557,6 +557,8 @@ class Workspace extends Model editor handleGrammarUsed: (grammar) -> + return unless grammar? + @packageManager.triggerActivationHook("#{grammar.packageName}:grammar-used") # Public: Returns a {Boolean} that is `true` if `object` is a `TextEditor`.