diff options
author | Stefan Haller <stefan@haller-berlin.de> | 2023-07-11 12:06:34 +0200 |
---|---|---|
committer | Stefan Haller <stefan@haller-berlin.de> | 2023-07-31 08:34:01 +0200 |
commit | 0c07963a2e76c54cbde14dc2da20450454f0e286 (patch) | |
tree | 9935e65ad8884cfa49c5eaafe6a9b3ae148fa28c /pkg | |
parent | 092d5dd608e997ea8be0aeda03be166987a0ca7b (diff) |
Store full sha in branch model
The model will be used for logic, so the full hash is needed there; a shortened
hash of 8 characters might be too short to be unique in very large repos. If
some view wants to display a shortened hash, it should truncate it at
presentation time.
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/commands/git_commands/branch_loader.go | 2 | ||||
-rw-r--r-- | pkg/gui/presentation/branches.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pkg/commands/git_commands/branch_loader.go b/pkg/commands/git_commands/branch_loader.go index 094354cad..b7e55a910 100644 --- a/pkg/commands/git_commands/branch_loader.go +++ b/pkg/commands/git_commands/branch_loader.go @@ -171,7 +171,7 @@ var branchFields = []string{ "upstream:short", "upstream:track", "subject", - fmt.Sprintf("objectname:short=%d", utils.COMMIT_HASH_SHORT_SIZE), + "objectname", } // Obtain branch information from parsed line output of getRawBranches() diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index 849a56eba..6d4620238 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -71,7 +71,7 @@ func getBranchDisplayStrings( } if fullDescription || userConfig.Gui.ShowBranchCommitHash { - res = append(res, b.CommitHash) + res = append(res, utils.ShortSha(b.CommitHash)) } res = append(res, coloredName) |