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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
git_borg_linker
Commits
3d17978f
Commit
3d17978f
authored
3 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/main.rs: usage of init_and_hook function to create the borg repository
parent
f542474a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.rs
+13
-3
13 additions, 3 deletions
src/main.rs
with
13 additions
and
3 deletions
src/main.rs
+
13
−
3
View file @
3d17978f
...
...
@@ -19,7 +19,7 @@ struct Cli {
#[derive(Debug,
Subcommand)]
enum
Commands
{
/// Initialize a borg repository inside a git project
Init
,
Init
(
Init
)
,
/// Save the results folder of a git repository in an archive
///
/// The archive will be named as the current commit in git
...
...
@@ -48,6 +48,16 @@ enum Commands {
CreateHooks
(
CreateHooks
),
}
#[derive(Debug,
Args)]
struct
Init
{
/// If specified, hooks are created inside `.git/hooks repository`
#[clap(takes_value
=
false
,
short,
long)]
hooks
:
bool
,
/// The compression to use automatically at each commit if hooks are created
#[clap(short,
long,
default_value
=
"lz4"
)]
compression
:
String
,
}
#[derive(Debug,
Args)]
struct
Commit
{
/// The compression used to save the results folder (no, lz4, zstd, zlib or lzma)
...
...
@@ -93,8 +103,8 @@ fn main() {
let
args
=
Cli
::
parse
();
match
args
.commands
{
Commands
::
Init
=>
{
init
::
init_
repository
(
);
Commands
::
Init
(
init
)
=>
{
init
::
init_
and_hook
(
init
.hooks
,
&
init
.compression
);
}
Commands
::
Commit
(
commit
)
=>
{
commit
::
commit
(
commit
.compression
,
String
::
from
(
""
),
commit
.update
);
...
...
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