Skip to content

Commit 8676e8a

Browse files
authored
Update gitapi.js
1 parent f058041 commit 8676e8a

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

git/gitapi.js

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,23 @@ let git = {
104104

105105
},
106106

107-
// get repository
107+
// get a repository
108108
'getRepo': async (treeLoc) => {
109109

110110
// map tree location
111111
let query = 'https://api.github.com';
112112
const [user, repo] = treeLoc;
113113

114-
const [repoName] = repo.split(':');
115-
114+
// get repository branch
115+
const [repoName, branch] = repo.split(':');
116+
116117
query += '/repos/' + user + '/' + repoName;
117-
118+
118119
// get the query
119120
const resp = await axios.get(query, gitToken);
120121

121122
return resp;
122-
123+
123124
},
124125

125126
// list branches for repository
@@ -139,25 +140,6 @@ let git = {
139140
return resp;
140141

141142
},
142-
143-
// get a repository
144-
'getRepo': async (treeLoc) => {
145-
146-
// map tree location
147-
let query = 'https://api.github.com';
148-
const [user, repo] = treeLoc;
149-
150-
// get repository branch
151-
const [repoName, branch] = repo.split(':');
152-
153-
query += '/repos/' + user + '/' + repoName;
154-
155-
// get the query
156-
const resp = await axios.get(query, gitToken);
157-
158-
return resp;
159-
160-
},
161143

162144
// push a file
163145
'push': async (commit) => {

0 commit comments

Comments
 (0)