Remove ohnogit

This commit is contained in:
joshaber 2016-07-15 18:35:07 -07:00
parent e7183edf37
commit 43866fade1
4 changed files with 10 additions and 10 deletions

View file

@ -37,7 +37,6 @@
"event-kit": "^2.0.0",
"keytar": "^3.0.2",
"octokat": "^0.5.0-beta.0",
"ohnogit": "0.0.14",
"react": "^15.0.2",
"react-dom": "^15.0.2"
},

View file

@ -39,11 +39,7 @@ const options = {
'/node_modules/electron-prebuilt($|/)',
'/node_modules/electron-packager($|/)',
'/\\.git($|/)',
'/node_modules/\\.bin($|/)',
'/node_modules/nodegit/vendor/libgit2/tests($|/)',
'/node_modules/nodegit/build/Release/obj.target($|/)',
'/node_modules/nodegit/vendor($|/)',
'/node_modules/ohnogit/spec($|/)'
'/node_modules/\\.bin($|/)'
],
// macOS

View file

@ -313,4 +313,11 @@ export class LocalGitOperations {
return Promise.resolve(commits)
}
/** Look up a config value by name in the repository. */
public static async getConfigValue(repository: Repository, name: string): Promise<string> {
const output = await this.execGitOutput([ 'config', '-z', name ], repository.path)
const pieces = output.split('\0')
return pieces[0]
}
}

View file

@ -12,8 +12,7 @@ import {Dispatcher} from '../lib/dispatcher'
import Repository from '../models/repository'
import {matchGitHubRepository} from '../lib/repository-matching'
import API, {getUserForEndpoint} from '../lib/api'
import {Repository as GitRepository} from 'ohnogit'
import { LocalGitOperations } from '../lib/local-git-operations'
interface AppState {
readonly selectedRow: number
@ -161,10 +160,9 @@ export default class App extends React.Component<AppProps, AppState> {
}
private async guessGitHubRepository(repository: Repository): Promise<GitHubRepository | null> {
const gitRepo = GitRepository.open(repository.path)
// TODO: This is all kinds of wrong. We shouldn't assume the remote is named
// `origin`.
const remote = await gitRepo.getConfigValue('remote.origin.url')
const remote = await LocalGitOperations.getConfigValue(repository, 'remote.origin.url')
if (!remote) { return null }
return matchGitHubRepository(this.state.users, remote)