mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-20 08:01:46 +03:00
disallow adding of repositories with submodules due incomplete support
This commit is contained in:
parent
72779bd481
commit
093f003890
@ -70,6 +70,10 @@ impl From<controller::AddError> for Error {
|
||||
code: Code::Projects,
|
||||
message: "Path not found".to_string(),
|
||||
},
|
||||
controller::AddError::SubmodulesNotSupported => Error::UserError {
|
||||
code: Code::Projects,
|
||||
message: "Repositories with git submodules are not supported".to_string(),
|
||||
},
|
||||
controller::AddError::User(error) => error.into(),
|
||||
controller::AddError::Other(error) => {
|
||||
tracing::error!(?error, "failed to add project");
|
||||
|
@ -66,6 +66,10 @@ impl Controller {
|
||||
return Err(AddError::NotAGitRepository);
|
||||
};
|
||||
|
||||
if path.join(".gitmodules").exists() {
|
||||
return Err(AddError::SubmodulesNotSupported);
|
||||
}
|
||||
|
||||
let id = uuid::Uuid::new_v4().to_string();
|
||||
|
||||
// title is the base name of the file
|
||||
@ -254,6 +258,8 @@ pub enum AddError {
|
||||
PathNotFound,
|
||||
#[error("project already exists")]
|
||||
AlreadyExists,
|
||||
#[error("submodules not supported")]
|
||||
SubmodulesNotSupported,
|
||||
#[error(transparent)]
|
||||
User(#[from] users::GetError),
|
||||
#[error(transparent)]
|
||||
|
Loading…
Reference in New Issue
Block a user