From cd4d6e838d7e00bceb600512a6cb691f610fd40d Mon Sep 17 00:00:00 2001 From: xbj110825 Date: Fri, 12 Jul 2024 14:06:25 +0800 Subject: [PATCH] fix: remote tracking branch configuration config Previously, the function always used 'origin' as the remote name. The command now dynamically uses the provided remote name, ensuring proper configuration for non-origin remotes. Signed-off-by: xbj110825 --- lib/ansible/modules/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/git.py b/lib/ansible/modules/git.py index 6142933b511..8273b0be001 100644 --- a/lib/ansible/modules/git.py +++ b/lib/ansible/modules/git.py @@ -1031,7 +1031,7 @@ def fix_remote_tracking_branch(git_path, module, dest, remote, version, single_b else: fetch_ref = '+refs/heads/*:refs/remotes/origin/*' - cmd = [git_path, 'config', 'remote.origin.fetch', fetch_ref] + cmd = [git_path, 'config', 'remote.%s.fetch' % remote, fetch_ref] (rc, out, err) = module.run_command(cmd, cwd=dest) if rc != 0: module.fail_json(