From 54551b117435a006acddefbf3850b02d6ee84ffa Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Tue, 9 Jul 2024 13:56:10 +0200 Subject: [PATCH] cli: Make sure to configure checkouts properly We were configure correctly on `rad init`, but not `rad checkout`. --- radicle-cli/examples/rad-checkout-repo-config-linux.md | 2 ++ radicle-cli/examples/rad-checkout-repo-config-macos.md | 2 ++ radicle/src/rad.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/radicle-cli/examples/rad-checkout-repo-config-linux.md b/radicle-cli/examples/rad-checkout-repo-config-linux.md index c08e8a0a..69c6f10e 100644 --- a/radicle-cli/examples/rad-checkout-repo-config-linux.md +++ b/radicle-cli/examples/rad-checkout-repo-config-linux.md @@ -11,6 +11,8 @@ $ cat .git/config repositoryformatversion = 0 filemode = true logallrefupdates = true +[push] + default = upstream [remote "rad"] url = rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji fetch = +refs/heads/*:refs/remotes/rad/* diff --git a/radicle-cli/examples/rad-checkout-repo-config-macos.md b/radicle-cli/examples/rad-checkout-repo-config-macos.md index e3f25242..42acc436 100644 --- a/radicle-cli/examples/rad-checkout-repo-config-macos.md +++ b/radicle-cli/examples/rad-checkout-repo-config-macos.md @@ -13,6 +13,8 @@ $ cat .git/config ignorecase = true precomposeunicode = true logallrefupdates = true +[push] + default = upstream [remote "rad"] url = rad://z42hL2jL4XNk6K8oHQaSWfMgCL7ji fetch = +refs/heads/*:refs/remotes/rad/* diff --git a/radicle/src/rad.rs b/radicle/src/rad.rs index 889a897b..b2e5f37f 100644 --- a/radicle/src/rad.rs +++ b/radicle/src/rad.rs @@ -222,6 +222,8 @@ pub fn checkout, S: storage::ReadStorage>( let repo = git2::Repository::init_opts(path.as_ref(), &opts)?; let url = git::Url::from(proj); + // Configure repository for radicle. + git::configure_repository(&repo)?; // Configure and fetch all refs from remote. git::configure_remote( &repo,