Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git_borg_linker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
git_borg_linker
Commits
0a13aedc
An error occurred while fetching merge requests data.
Verified
Commit
0a13aedc
authored
Feb 1, 2023
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/remote.rs: update remote with the new config
parent
cfb6b9a4
Branches
Branches containing commit
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/remote.rs
+15
-10
15 additions, 10 deletions
src/remote.rs
with
15 additions
and
10 deletions
src/remote.rs
+
15
−
10
View file @
0a13aedc
...
...
@@ -27,10 +27,12 @@ pub fn parse_config(global: bool) -> Config {
let
config_file
=
get_optional_config
(
global
);
let
config_file
=
match
config_file
{
None
=>
{
return
Config
{
gblk_prune
:
None
,
gblk_remote
:
None
,
};
if
global
{
return
Config
::
new
(
global
);
}
else
{
eprintln!
(
"{}: local config should exists !"
,
"error"
.red
());
exit
(
1
);
}
}
Some
(
c
)
=>
c
,
};
...
...
@@ -46,12 +48,15 @@ pub fn parse_config(global: bool) -> Config {
Ok
(
s
)
=>
s
,
};
if
content
.is_empty
()
{
return
Config
{
gblk_prune
:
None
,
gblk_remote
:
None
,
};
if
global
{
return
Config
::
new
(
global
);
}
else
{
eprintln!
(
"{}: local config should not be empty !"
,
"error"
.red
());
exit
(
1
);
}
}
let
config_str
:
Config
=
toml
::
from_str
(
&
content
)
.unwrap
();
config_str
.check_project_type
(
global
,
&
config_file
);
config_str
}
...
...
@@ -106,7 +111,7 @@ fn get_remotes(global: bool) -> Option<Vec<RemoteConfig>> {
/// Get a dictionary of locally and globally defined remotes
/// # Return
/// A dictionary linking remote name and remote config globally and locally
defined
/// A dictionary linking remote name and remote config globally and locally
pub
(
crate
)
fn
get_dic_remotes
()
->
Dict
<
String
,
(
RemoteConfig
,
String
)
>
{
let
remote_global
=
get_remotes
(
true
);
let
remote_local
=
get_remotes
(
false
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment