From 4c82f42c2a063bb70ce8b59a335aa6b3161d01f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 21 Feb 2022 19:43:35 +0100 Subject: [PATCH] WIP: Note about branch prefixes --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 3bc321b..9046236 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -579,6 +579,12 @@ pub fn add_worktree( } else { let remote_branch_name = match track_config.default_remote_prefix { Some(prefix) => { + repo.set_config_push(GitPushDefaultSetting::Upstream)?; + + if repo.remotes()?.len() > 1 { + println!("Warning: You are using branch prefixes together with multiple remotes. This will have a few unexpected effects. When pushing to your non-default remote, you will always have to add a refspec explicitly, like so: git push myremote master. See TODO DOCLINK for more details") + + } format!("{}{}{}", &prefix, BRANCH_NAMESPACE_SEPARATOR, &name) } None => name.to_string(),