git-remote-entire: clarify info-flag guard comment. · Entire

git-remote-entire: clarify info-flag guard comment.

c5aaaf0→main·

toothbrush·1mo ago·1 file·+4 added/-3 removed

Disambiguate "(two args)" by stating os.Args lengths explicitly.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

c674d0c5ddd7View transcript

Changes

1

50 unmodified lines

51
52
53
54
55
56
54
55
56
57
58
59
60

50 unmodified lines

}

func run(args []string) int {
    // --version / --help only activate as the sole argument. Git always invokes
    // the helper as `git-remote-entire <remote-name> <url>` (two args), so these
    // can never collide with a real remote-helper invocation.
    // --version / --help only activate as the sole argument (so os.Args has
    // length 2). Git always invokes the helper as
    // `git-remote-entire <remote-name> <url>` (os.Args length 3), so these can
    // never collide with a real remote-helper invocation.
    if len(args) == 2 {
        if text, ok := infoFlagText(args[1], loadedVersion()); ok {
            fmt.Fprint(os.Stdout, text)

Mcmd/git-remote-entire/main.go+4/-3