import axios from 'axios';
// 获取分支列表
export const getBranch = async (id,owner)=>{
  let res = await axios.get(`/${owner}/${id}/branches.json`);
  return res&&res.data;
}
// 获取标签列表
export const getTag = async (id,owner)=>{
  return (await axios.get(`/${owner}/${id}/tags.json`)).data;
}
// 获取hooks（仓库设置-管理web钩子）列表
export const getHooks = async (id,params)=>{
  return (await axios.get(`/projects/${id}/hooks.json`,{params})).data;
}
// 获取子目录列表
export const getSubEntries = async (owner,projectsId,params)=>{
  return (await axios.get(`/${owner}/${projectsId}/sub_entries.json`,{params})).data;
}
// 获取用户信息
export const getUser = async (login)=>{
  return (await axios.get(`/users/${login}/hovercard.json`)).data;
}