Fix tag truncated when copying to clipboard

Copy the whole tag to clipboard instead of truncating to the value of
TruncateCopiedCommitHashesTo.
This commit is contained in:
Bruno Jesus 2025-02-03 21:25:34 +00:00
parent 49f8dc2ce4
commit 4856c96521
2 changed files with 4 additions and 4 deletions

View file

@ -148,7 +148,7 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
{
ViewName: "tags",
Key: opts.GetKey(opts.Config.Universal.CopyToClipboard),
Handler: self.handleCopySelectedSideContextItemCommitHashToClipboard,
Handler: self.handleCopySelectedSideContextItemToClipboard,
GetDisabledReason: self.getCopySelectedSideContextItemToClipboardDisabledReason,
Description: self.c.Tr.CopyTagToClipboard,
},

View file

@ -15,7 +15,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
},
SetupRepo: func(shell *Shell) {
shell.EmptyCommit("one")
shell.CreateLightweightTag("tag1", "HEAD")
shell.CreateLightweightTag("super.l000ongtag", "HEAD")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Tags().
@ -25,7 +25,7 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
).
Press(keys.Universal.CopyToClipboard)
t.ExpectToast(Equals("'tag1' copied to clipboard"))
t.ExpectToast(Equals("'super.l000ongtag' copied to clipboard"))
t.Views().Files().
Focus().
@ -34,6 +34,6 @@ var CopyToClipboard = NewIntegrationTest(NewIntegrationTestArgs{
Contains("clipboard").IsSelected(),
)
t.Views().Main().Content(Contains("_tag1_"))
t.Views().Main().Content(Contains("super.l000ongtag"))
},
})