GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — clibrowser/cligit/src/git_shell.rs at main · allthingssecurity/clibrowser

Expand file tree

/

git_shell.rs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
22 lines (20 loc) · 780 Bytes
/

git_shell.rs

Copy path

File metadata and controls

22 lines (20 loc) · 780 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::path::Path;
use std::process::Command;
use crate::error::GitError;
pub fn shell_git(args: &[&str], workdir: &Path) -> Result<String, GitError> {
let output = Command::new("git")
.args(args)
.current_dir(workdir)
.output()
.map_err(|e| GitError::Io(format!("failed to run git: {}", e)))?;
if output.status.success() {
Ok(String::from_utf8_lossy(&output.stdout).to_string())
} else {
let stderr = String::from_utf8_lossy(&output.stderr).to_string();
if stderr.contains("Authentication") || stderr.contains("could not read Username") {
Err(GitError::AuthRequired(stderr.trim().to_string()))
} else {
Err(GitError::RemoteError(stderr.trim().to_string()))
}
}
}
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.