Don't display the "refs/heads" component of branches

This commit is contained in:
blinry 2021-01-14 11:41:03 +01:00
parent b6300c16d9
commit b0caf4693c

View file

@ -17,6 +17,7 @@ var arrow = preload("res://scenes/arrow.tscn")
func _ready(): func _ready():
content_set(content) content_set(content)
type_set(type) type_set(type)
id_set(id)
if not repository.simplified_view or (type != "tree" and type != "blob"): if not repository.simplified_view or (type != "tree" and type != "blob"):
$Pop.pitch_scale = rand_range(0.8, 1.2) $Pop.pitch_scale = rand_range(0.8, 1.2)
$Pop.play() $Pop.play()
@ -57,6 +58,10 @@ func apply_forces():
func id_set(new_id): func id_set(new_id):
id = new_id id = new_id
$ID.text = id $ID.text = id
if type == "ref":
$ID.text = $ID.text.replace("refs/heads/", "")
$ID.text = $ID.text.replace("refs/remotes/", "")
$ID.text = $ID.text.replace("refs/tags/", "")
func content_set(new_content): func content_set(new_content):
content = new_content content = new_content