Thread (15 messages) 15 messages, 4 authors, 2021-06-08

[PATCH v2 try2 1/4] completion: bash: fix prefix detection in branch.*

flat view
STALE1974d SUPERSEDED: 1 (0M)

From: Felipe Contreras <hidden>
Date: 2021-06-06 18:48:53
Subsystem: the rest · Maintainer: Linus Torvalds

Status: Superseded by v5 (posted 2021-07-07). [go to v5]

Revision v2 (5 revisions archived); 1 review trailer.

Revisions (5)
  1. v1 re-posted go to this post
  2. v2 current [diff against previous] re-posted current
  3. v3 [diff against previous] re-posted go to this post
  4. v4 [diff against previous]
  5. v5 [diff against previous]
Otherwise we are completely ignoring the --cur argument.

The issue can be tested with:

  git clone --config=branch.<tab>

Reviewed-by: SZEDER Gábor <redacted>
Signed-off-by: Felipe Contreras <redacted>
---
 contrib/completion/git-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b50c5d0ea3..47b48fbab6 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -2649,8 +2649,8 @@ __git_complete_config_variable_name ()
 		return
 		;;
 	branch.*)
-		local pfx="${cur%.*}."
-		cur_="${cur#*.}"
+		local pfx="${cur_%.*}."
+		cur_="${cur_#*.}"
 		__gitcomp_direct "$(__git_heads "$pfx" "$cur_" ".")"
 		__gitcomp_nl_append $'autoSetupMerge\nautoSetupRebase\n' "$pfx" "$cur_" "$sfx"
 		return
-- 
2.31.1.2.g0532ba4bf6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help