summaryrefslogtreecommitdiffstats
path: root/pkg/commands/git_commands/stash.go
diff options
context:
space:
mode:
authorpikomonde <32364823+pikomonde@users.noreply.github.com>2024-03-21 00:44:56 +0700
committerStefan Haller <stefan@haller-berlin.de>2024-04-12 08:33:47 +0200
commite6ef1642fa0111e075fd14493b913cc4f7098db6 (patch)
treec5c31abe793c3b0b156d84afc28962f091fce9cb /pkg/commands/git_commands/stash.go
parent84333eebc3be466b23627f6709ad6b000ddd21f1 (diff)
rename sha to hash
Diffstat (limited to 'pkg/commands/git_commands/stash.go')
-rw-r--r--pkg/commands/git_commands/stash.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/commands/git_commands/stash.go b/pkg/commands/git_commands/stash.go
index 29140e68e..906535fe5 100644
--- a/pkg/commands/git_commands/stash.go
+++ b/pkg/commands/git_commands/stash.go
@@ -60,24 +60,24 @@ func (self *StashCommands) Push(message string) error {
return self.cmd.New(cmdArgs).Run()
}
-func (self *StashCommands) Store(sha string, message string) error {
+func (self *StashCommands) Store(hash string, message string) error {
trimmedMessage := strings.Trim(message, " \t")
cmdArgs := NewGitCmd("stash").Arg("store").
ArgIf(trimmedMessage != "", "-m", trimmedMessage).
- Arg(sha).
+ Arg(hash).
ToArgv()
return self.cmd.New(cmdArgs).Run()
}
-func (self *StashCommands) Sha(index int) (string, error) {
+func (self *StashCommands) Hash(index int) (string, error) {
cmdArgs := NewGitCmd("rev-parse").
Arg(fmt.Sprintf("refs/stash@{%d}", index)).
ToArgv()
- sha, _, err := self.cmd.New(cmdArgs).DontLog().RunWithOutputs()
- return strings.Trim(sha, "\r\n"), err
+ hash, _, err := self.cmd.New(cmdArgs).DontLog().RunWithOutputs()
+ return strings.Trim(hash, "\r\n"), err
}
func (self *StashCommands) ShowStashEntryCmdObj(index int) oscommands.ICmdObj {
@@ -179,7 +179,7 @@ func (self *StashCommands) StashIncludeUntrackedChanges(message string) error {
}
func (self *StashCommands) Rename(index int, message string) error {
- sha, err := self.Sha(index)
+ hash, err := self.Hash(index)
if err != nil {
return err
}
@@ -188,7 +188,7 @@ func (self *StashCommands) Rename(index int, message string) error {
return err
}
- err = self.Store(sha, message)
+ err = self.Store(hash, message)
if err != nil {
return err
}