Skip to content

Conversation

@google-labs-jules
Copy link

Jules PR

This commit introduces the 'add' command, which allows you to stage files for the next commit.

Key changes:
- I created `src/vcs/add.rs` to house the logic for the 'add' command.
- The `add` function updates the `.rust-vcs/index` file with the paths and hashes of the specified files. If a file is already in the index, its hash is updated.
- I added `pub mod add` to `src/vcs/mod.rs`.
- I updated `src/main.rs` to call the `vcs::add::add` function when the `add` subcommand is used.
- I added comprehensive integration tests for the 'add' command in `src/vcs/tests/add_test.rs`. These tests cover:
    - Adding a single new file.
    - Adding multiple files.
    - Adding an existing file (verifying hash update).
    - Attempting to add a non-existent file.
    - Adding a file located in a subdirectory.
- I ensured tests run serially to prevent CWD conflicts during testing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant