detached 8621d22

fix(review): address coderabbit code review feedback

commit
8621d22bb977197a77fa2100b9c7ef61d3250bd3
author
bnema · · 2026-01-31 21:22 UTC
parent
8df0e57
signature
unsigned
2 files · +9 -4
M internal/adapters/in/cli/auth.go +6 -3
@@ -271,7 +271,6 @@ func runAuthLogin(remoteName, username, password string) error {
271271 return fmt.Errorf("username cannot be empty")
272272 }
273273
274- password = strings.TrimSpace(password)
275274 if password == "" {
276275 // Prompt for password (hidden input)
277276 fmt.Print("Password: ")
@@ -283,10 +282,14 @@ func runAuthLogin(remoteName, username, password string) error {
283282 if readErr != nil {
284283 return fmt.Errorf("failed to read password: %w", readErr)
285284 }
286- passwordBytes = []byte(strings.TrimSpace(passwordInput))
285+ // Only trim trailing newline from fallback input
286+ passwordBytes = []byte(strings.TrimRight(passwordInput, "\r\n"))
287287 }
288288 fmt.Println()
289- password = strings.TrimSpace(string(passwordBytes))
289+ password = string(passwordBytes)
290+ } else {
291+ // Only trim trailing newline from flag-provided password
292+ password = strings.TrimRight(password, "\r\n")
290293 }
291294
292295 if password == "" {
@@ -271,7 +271,6 @@ func runAuthLogin(remoteName, username, password string) error {
271 return fmt.Errorf("username cannot be empty")271 return fmt.Errorf("username cannot be empty")
272 }272 }
273 273
274- password = strings.TrimSpace(password)
275 if password == "" {274 if password == "" {
276 // Prompt for password (hidden input)275 // Prompt for password (hidden input)
277 fmt.Print("Password: ")276 fmt.Print("Password: ")
@@ -283,10 +282,14 @@ func runAuthLogin(remoteName, username, password string) error {
283 if readErr != nil {282 if readErr != nil {
284 return fmt.Errorf("failed to read password: %w", readErr)283 return fmt.Errorf("failed to read password: %w", readErr)
285 }284 }
286- passwordBytes = []byte(strings.TrimSpace(passwordInput))285+ // Only trim trailing newline from fallback input
286+ passwordBytes = []byte(strings.TrimRight(passwordInput, "\r\n"))
287 }287 }
288 fmt.Println()288 fmt.Println()
289- password = strings.TrimSpace(string(passwordBytes))289+ password = string(passwordBytes)
290+ } else {
291+ // Only trim trailing newline from flag-provided password
292+ password = strings.TrimRight(password, "\r\n")
290 }293 }
291 294
292 if password == "" {295 if password == "" {
M internal/adapters/out/domainsecrets/pass_store.go +3 -1
@@ -257,7 +257,9 @@ func (s *PassStore) ListAttachmentKeys(domainName string) ([]out.AttachmentSecre
257257 return nil, err
258258 }
259259
260- content, exists, err := s.passShow(ctx, manifestPath)
260+ showCtx, showCancel := context.WithTimeout(context.Background(), s.timeout)
261+ content, exists, err := s.passShow(showCtx, manifestPath)
262+ showCancel()
261263 if err != nil {
262264 return nil, err
263265 }
@@ -257,7 +257,9 @@ func (s *PassStore) ListAttachmentKeys(domainName string) ([]out.AttachmentSecre
257 return nil, err257 return nil, err
258 }258 }
259 259
260- content, exists, err := s.passShow(ctx, manifestPath)260+ showCtx, showCancel := context.WithTimeout(context.Background(), s.timeout)
261+ content, exists, err := s.passShow(showCtx, manifestPath)
262+ showCancel()
261 if err != nil {263 if err != nil {
262 return nil, err264 return nil, err
263 }265 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 106

↑↓ moveenter openesc close