Add git.clone and git.checkout states
This commit is contained in:
@@ -62,6 +62,20 @@ class Repository extends Injectable {
|
||||
await this._git_cmd(`checkout "${ref}"`)
|
||||
}
|
||||
|
||||
async current_branch() {
|
||||
const cd_cmd = await this._host.get_directory_change_command(this._path)
|
||||
const cmd = `${cd_cmd} && git symbolic-ref HEAD`
|
||||
const full_ref = await this._host.run_line_result(cmd)
|
||||
return full_ref.replace('refs/heads/', '')
|
||||
}
|
||||
|
||||
async current_ref() {
|
||||
const cd_cmd = await this._host.get_directory_change_command(this._path)
|
||||
const cmd = `${cd_cmd} && git show-ref HEAD`
|
||||
const ref = await this._host.run_line_result(cmd)
|
||||
return ref.split(' ')[0]
|
||||
}
|
||||
|
||||
async stash() {
|
||||
await this._git_cmd(`stash`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user