From 5e539771c563435a90bb10f1dd8c90d9e0863a9d Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Mon, 26 Sep 2022 08:42:41 -0700 Subject: [PATCH] git: include a hint about possible permission error when push fails When the remote rejects a push, we now say something like this: ``` Remote rejected the update of some refs (do you have permission to push to ["refs/heads/main"]?) ``` That message could be formatted better, but this seems good enough for now. We should probably have some more custom conversion from `GitPushError` to `CommandError` in the CLI layer. --- lib/src/git.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/git.rs b/lib/src/git.rs index c480d6506..dc5d9a271 100644 --- a/lib/src/git.rs +++ b/lib/src/git.rs @@ -319,7 +319,7 @@ pub enum GitPushError { NoSuchRemote(String), #[error("Push is not fast-forwardable")] NotFastForward, - #[error("Remote reject the update of some refs")] + #[error("Remote rejected the update of some refs (do you have permission to push to {0:?}?)")] RefUpdateRejected(Vec), // TODO: I'm sure there are other errors possible, such as transport-level errors, // and errors caused by the remote rejecting the push.