Add git.tag state; abstract out AbstractGitState class
This commit is contained in:
@@ -50,10 +50,20 @@ class Repository extends Injectable {
|
||||
await this._git_cmd(`commit -m "${message}"`)
|
||||
}
|
||||
|
||||
async tag(label) {
|
||||
async create_tag(label) {
|
||||
await this._git_cmd(`tag "${label}"`)
|
||||
}
|
||||
|
||||
async delete_tag(label) {
|
||||
await this._git_cmd(`tag --delete "${label}"`)
|
||||
}
|
||||
|
||||
async get_tag(label) {
|
||||
const cd_cmd = await this._host.get_directory_change_command(this._path)
|
||||
const cmd = `${cd_cmd} && git rev-parse "${label}"`
|
||||
return await this._host.run_line_result(cmd)
|
||||
}
|
||||
|
||||
async push(target = false, ref = false) {
|
||||
await this._git_cmd(`push${target ? ' '+target : ''}${ref ? ' '+ref : ''} --tags`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user