Skip to content

unstage file #1104

Closed
Closed
@harilet

Description

@harilet

I was trying to unstage files. I can add file fine by using

let mut index = repo.index().unwrap();
index.add_path(Path::new(&path)).unwrap();

I saw we can use the remove_path like this

let mut index = repo.index().unwrap();
index.remove_path(Path::new(&path)).unwrap();
index.write().unwrap();

but this deletes file not remove changes
Image

what can I do?
and I saw this remove but the 2th parameter stage is an int but have no more detail
https://docs.rs/git2/latest/git2/struct.Index.html#method.remove

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions