GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — clibrowser/cligit/src/commands/stage.rs at main · allthingssecurity/clibrowser Expand file tree/ Copy pathstage.rsMore file actions 27 lines (24 loc) · 797 Bytes / Copy pathstage.rsFile metadata and controls27 lines (24 loc) · 797 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 use anyhow::Result; use crate::cli::StageArgs; use crate::git_ctx::GitContext; use crate::models::*; use crate::output::OutputConfig; pub fn execute(args: StageArgs, ctx: &GitContext, out: &OutputConfig) -> Result<i32> { let repo = &ctx.repo; let mut index = repo.index()?; for file in &args.files { let path = std::path::Path::new(file); if ctx.workdir.join(path).exists() { index.add_path(path)?; } else { // File was deleted, remove from index index.remove_path(path)?; } } index.write()?; let msg = format!("Staged {} file(s)", args.files.len()); let result = WriteResult { message: msg }; if out.json { out.print_json(&result); } else { out.print_human(&result.message); } Ok(0) } |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |