From 5c8fecdaf68393cec08fa7bee3b96c1da29dadbd Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 5 Jan 2024 16:21:31 +0100 Subject: [PATCH] git: diff - fix refrange so seems `..` works, but `...` has no results --- completers/git_completer/cmd/diff.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/completers/git_completer/cmd/diff.go b/completers/git_completer/cmd/diff.go index 0019fd5b36..a5819476bc 100644 --- a/completers/git_completer/cmd/diff.go +++ b/completers/git_completer/cmd/diff.go @@ -37,7 +37,7 @@ func init() { filtered := make([]string, 0) for index, arg := range c.Args { - if index == 0 && strings.Contains(arg, "...") { // assume refrange - TODO what about '{ref}..{ref}' + if index == 0 && strings.Contains(arg, "..") { // assume refrange - TODO what about '{ref}...{ref}' filtered = append(filtered, arg) break } @@ -54,7 +54,7 @@ func init() { batch = append(batch, git.ActionRefRanges(git.RefOption{}.Default())) default: switch { - case strings.Contains(c.Args[0], "..."): // skip if we already have a refrange + case strings.Contains(c.Args[0], ".."): // skip if we already have a refrange case diffCmd.Flag("cached").Changed: // skip as '-cached' accepts only on ref default: batch = append(batch, git.ActionRefs(git.RefOption{}.Default())) @@ -63,8 +63,8 @@ func init() { } if len(filtered) > 0 { - // TODO support/suppress '{ref}..{ref}'?? - filtered = append(strings.SplitN(filtered[0], "...", 2), filtered[1:]...) // split refrange if any + // TODO support/suppress '{ref}...{ref}'?? + filtered = append(strings.SplitN(filtered[0], "..", 2), filtered[1:]...) // split refrange if any } switch len(filtered) {