0
서버에있는 git repo의 로컬 브랜치 목록을 사용자에게 보내야하는 노드 API 서버를 작성 중입니다. 장소의 많은 NodeGit에서 Repository#getReferenceNames을 사용하는 것이 좋습니다 이것은 내가 할 것입니다 :NodeGit 로컬 지점 목록을 얻으려면 어떻게해야합니까?
exports.getBranches = function (req, res) {
NodeGit.Repository.open(config.database).then(function(repo) {
return repo.getReferenceNames(NodeGit.Reference.TYPE.LISTALL);
}).then(function (arrayString) {
res.status(200).json({message: "OK", data: arrayString});
}).catch(function (err) {
res.status(500).json({message: err, data: []});
}).done(function() {
console.log("finish");
});
};
그러나,이 기능은 모든 지점을 반환합니다. 거기에 명령 줄처럼 로컬 지점을 얻을 수있는 방법이 있습니까 git branch
합니까?