Skip to content

Clean up hardcoded "origin" fallbacks and redundant LoadConfig() call #81

@alexrinass

Description

@alexrinass

Six places fall back to a hardcoded "origin" string instead of relying solely on cfg.Remote (which already defaults to "origin" during config loading). One also makes a redundant LoadConfig() call just to get the remote name when cfg is already in scope. Behavior is currently correct, but the fallbacks are misleading and the extra LoadConfig() is wasteful.

Locations

Hardcoded "origin" fallback pattern (if remote == "" { remote = "origin" }):

  • cmd/publish.go:93-94
  • cmd/track.go:72-73
  • cmd/delete.go:61-62
  • cmd/delete.go:140-141
  • cmd/update.go:141-142

Redundant LoadConfig() + "origin" fallback:

Suggested Fix

Remove all if remote == "" { remote = "origin" } fallbacks and use cfg.Remote directly. Thread cfg into handleCreateTagStep and remove the redundant LoadConfig() call.

Related: PR #74

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions