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
7a776597
Commit
7a776597
authored
May 11, 2022
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/checkout.rs: temporary commit deletion using delete_commit function
parent
059914a2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/checkout.rs
+2
-13
2 additions, 13 deletions
src/checkout.rs
with
2 additions
and
13 deletions
src/checkout.rs
+
2
−
13
View file @
7a776597
...
@@ -70,20 +70,9 @@ pub fn prepare_checkout() {
...
@@ -70,20 +70,9 @@ pub fn prepare_checkout() {
check_if_current_commit_exits
(
&
borg_path
,
&
commit_id
);
check_if_current_commit_exits
(
&
borg_path
,
&
commit_id
);
// Create an archive with the content of the current commit
// Create an archive with the content of the current commit
let
tmp_name
=
format!
(
"{}-tmp"
,
commit_id
);
let
tmp_name
=
format!
(
"{}-tmp"
,
commit_id
);
commit
::
commit
(
String
::
from
(
"none"
),
tmp_name
.clone
());
commit
::
commit
(
String
::
from
(
"none"
),
tmp_name
.clone
()
,
false
);
let
res
=
is_diff
(
&
commit_id
,
&
tmp_name
,
&
borg_path
);
let
res
=
is_diff
(
&
commit_id
,
&
tmp_name
,
&
borg_path
);
let
output
=
Command
::
new
(
"borg"
)
commit
::
delete_commit
(
&
tmp_name
,
&
borg_path
);
.arg
(
"delete"
)
.arg
(
format!
(
"{}::{}"
,
borg_path
.to_str
()
.unwrap
(),
tmp_name
))
.output
()
.unwrap
();
match
output
.status
.code
()
.unwrap
()
{
0
=>
(),
num
=>
{
eprintln!
(
"{}"
,
String
::
from_utf8
(
output
.stderr
)
.unwrap
());
exit
(
num
);
}
}
if
res
{
if
res
{
eprintln!
(
"Your results folder contains unsaved changes!
\n
Please update your current commit with: gbl commit --update"
);
eprintln!
(
"Your results folder contains unsaved changes!
\n
Please update your current commit with: gbl commit --update"
);
exit
(
4
);
exit
(
4
);
...
...
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