Jean-Claude
a6b254ca2d
Disable signing of commits
...
This leads to problems as it requires the unlocked GPG key. It also
slows down the process.
2023-10-09 15:09:50 +02:00
Jean-Claude
255f1df055
Cleanup add missing & and remove unnecessary change of CWD
2023-10-09 15:08:43 +02:00
Jean-Claude
5f8ccf0ab0
Fix tempdir collisions between testing functions
...
testdir sees parametrized tests as caseN instead of testXY:caseN. This
leads to collisions between multiple testing functions.
An issue was filed: https://github.com/flub/testdir/issues/6
2023-10-09 15:03:25 +02:00
Jean-Claude
efc28c3bd0
Add testcases for git module
...
Updates the function signature of a few functions to pass the repository
or its path.
2023-10-08 21:46:25 +02:00
Jean-Claude
3325a28bd8
Use `testdir` instead of own tmpdir implementation
...
This crate seems well suited for our task. The code is also simpler as
we deal with a PathBuf directly.
2023-09-13 12:14:27 +02:00
Jean-Claude
e0c16c2cd4
Use rstest for format_string tests to simplify testing
2023-09-12 21:17:18 +02:00
Jean-Claude
7ecbf5b5a3
Add unit tests for config
2023-09-11 22:53:19 +02:00
Jean-Claude
89235fc1b9
Add fixtures for temporary paths
2023-09-11 22:43:28 +02:00
Jean-Claude
2b14de9287
Add testing crates rstest and pretty_assertions
2023-09-10 17:29:13 +02:00
Jean-Claude
a2bb209e2c
Fix library returned path to .git instead of root
...
It seems like git2::Repository::discover_path returns the path to `.git`
and no longer to the actual root of the repository.
2023-08-22 16:45:07 +02:00
Jean-Claude
6aae4afa06
Add error handling to application
...
No new Error enums were created but `whatever` was used. At some places
an explicit error would probably be better.
2023-08-22 16:19:07 +02:00
Jean-Claude
747b34d51f
Add proper error handling for metadata
...
Only patches the library, but not the application yet
2023-08-22 09:27:41 +02:00
Jean-Claude
027db6013c
Add proper error handling for archive
...
Only patches the library, but not the application yet
2023-08-22 09:27:41 +02:00
Jean-Claude
f78831000b
Add helper function to run git commands
2023-08-22 09:27:41 +02:00
Jean-Claude
68295540bb
Add proper error handling for git
...
Only patches the library, but not the application yet
2023-08-22 09:27:41 +02:00
Jean-Claude
2c2fae4e36
Add proper error handling for config
...
Only patches the library, but not the application yet
2023-08-22 09:27:37 +02:00
Jean-Claude
c8cdf22e0b
Update deps
2023-05-18 22:26:23 +02:00
Jean-Claude
f2e6c300d6
Check that repo is in clean state before certain operations
...
If repo is not clean, certain changes may get lost during certain
operations.
2023-05-17 20:17:39 +02:00
Jean-Claude
329401545a
Extract creation datetime from image
2023-05-16 23:31:26 +02:00
Jean-Claude
3f8ff09374
Add basic functionality to crate a new image import
...
The image creation time is not yet correctly read out of the image.
2023-05-16 11:41:14 +02:00
Jean-Claude
4203c6b993
Make function to method
...
There is not need to have `get_root` a function. Make it a method of
`Archive`.
2023-05-14 20:58:24 +02:00
Jean-Claude
86286b35d1
Add option to get config from main branch
...
This is necessary we are in a import branch and need access to the
config
2023-05-14 20:53:07 +02:00
Jean-Claude
428603440e
Add crude function to dump default config
2023-05-14 20:12:00 +02:00
Jean-Claude
fef7e93626
Cleanup and minor improvement
2023-05-14 18:10:44 +02:00
Jean-Claude
dd966b4343
Restructure format string
...
Create module with base functionality and two "wrapper-modules", using
that functionality.
2023-05-14 18:09:54 +02:00
Jean-Claude
2d56d89776
Represent state of import in structs
...
`ImportState` holds the state of the general import, while `ImportImage`
holds the state of a single image to be imported.
2023-04-23 22:02:19 +02:00
Jean-Claude
b468831269
Split import subcommands into separate files
...
This should make it easier to extend them
2023-04-18 22:17:23 +02:00
Jean-Claude
ba648f7316
Add module representing format strings
...
FormatStrings repesent the import branch as well as the image
destination
2023-04-18 22:04:29 +02:00
Jean-Claude
37036dfc81
Lint code and fix errors
2023-04-18 21:30:04 +02:00
Jean-Claude
969db33c95
Add rustfmt config file and install pre-commit
2023-04-18 21:28:37 +02:00
Jean-Claude
a112c7f7a0
Add verification if on right branch before changing branch
...
This prevents unnecessary "checkout"s. Unfortunately, this also requires
an "feature" to create `if let XXX && YYY` chains
2023-03-21 22:31:25 +01:00
Jean-Claude
58755eb2ee
Improve structure by moving branch switch go git
2023-03-11 17:43:56 +01:00
Jean-Claude
2a8d8f1575
Ensure all import images are valid files
...
Check that all images for importing are actual files. It is not ensured
that they are valid images itself.
2023-03-11 17:00:34 +01:00
Jean-Claude
13246cb592
NEW: Deactivate functionality
...
Added a deactivate functionality. To prevent repeating code, the
"checkout" code from `activate` was moved to method `checkout_branch` of
`Archive`.
2023-02-28 12:04:49 +01:00
Jean-Claude
1fd62ff2db
NEW: read import_branch_prefix from config
...
Prior, a hard-coded global was used
2023-02-28 12:03:33 +01:00
Jean-Claude
64d6f87fad
NEW: read configuration from file
...
Mia expects a configuration file to be present in the archive root. Upon
the creation of `Archive`, this file is read too. We do not make use of
the config yet.
2023-02-28 11:55:43 +01:00
Jean-Claude
f127c9771e
NEW: functionality for listing and activating imports
2023-02-27 22:05:30 +01:00
Jean-Claude
b04288482b
Represent archive as struct and validate it
...
Each archive contains the path to the root of the archive. `git
rev-parse` is used to get the git (/archive) root.
2023-02-15 20:32:28 +01:00
Jean-Claude
eb5c543016
Add basic cli parsing and running subcommands
2023-01-29 22:14:09 +01:00
Jean-Claude
39328b78ce
Initial commit setup project using cargo
2023-01-29 14:23:08 +01:00