mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Take char* path in constructor
This commit is contained in:
committed by
Corey Johnson
parent
a3ef53f8e6
commit
34bf39e364
@@ -11,8 +11,7 @@ class GitRepository : public CefBase {
|
||||
git_repository *repo;
|
||||
|
||||
public:
|
||||
GitRepository(CefRefPtr<CefV8Value> path) {
|
||||
const char *repoPath = path->GetStringValue().ToString().c_str();
|
||||
GitRepository(const char *repoPath) {
|
||||
exists = git_repository_open_ext(&repo, repoPath, 0, NULL) == GIT_OK;
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ bool Git::Execute(const CefString& name,
|
||||
CefRefPtr<CefV8Value>& retval,
|
||||
CefString& exception) {
|
||||
if (name == "getRepository") {
|
||||
CefRefPtr<CefBase> userData = new GitRepository(arguments[0]);
|
||||
CefRefPtr<CefBase> userData = new GitRepository(arguments[0]->GetStringValue().ToString().c_str());
|
||||
retval = CefV8Value::CreateObject(NULL);
|
||||
retval->SetUserData(userData);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user