Opt/app layout #18

Merged
Christoph merged 4 commits from opt/app_layout into main 2026-07-06 09:36:07 +00:00
3 changed files with 40 additions and 8 deletions
Showing only changes of commit d592894f28 - Show all commits
+2 -1
View File
@@ -78,7 +78,8 @@
"Bash(rustfmt --edition 2024 --check src/badge.rs src/main.rs)",
"Bash(rustfmt --edition 2024 --check src/git.rs)",
"Bash(rustfmt --edition 2024 --check src/badge.rs)",
"Bash(rustfmt --edition 2024 --check src/git.rs src/main.rs)"
"Bash(rustfmt --edition 2024 --check src/git.rs src/main.rs)",
"Bash(pkg-config --list-all)"
]
}
}
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "git-lite",
"version": "2026.7.12",
"version": "2026.7.11",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "git-lite",
"version": "2026.7.12",
"version": "2026.7.11",
"dependencies": {
"@lucide/svelte": "^1.21.0",
"@tailwindcss/vite": "^4.3.1",
+34 -3
View File
@@ -3415,16 +3415,47 @@ fn is_auth_error(details: &str) -> bool {
|| d.contains("authentication required")
}
// Windows' CreateProcess rejects command lines longer than ~32K chars with
// "os error 206" (filename or extension too long). Staging/restoring a large
// number of files can easily exceed that, so split the paths across multiple
// invocations and concatenate their output.
const MAX_PATH_ARGS_CHARS: usize = 8_000;
fn run_git_with_paths(
repo: &Path,
base_args: &[&str],
files: &[String],
) -> Result<Vec<u8>, String> {
let mut args = Vec::with_capacity(base_args.len() + files.len() + 1);
if files.is_empty() {
let args: Vec<OsString> = base_args.iter().map(OsString::from).collect();
return run_git(repo, args);
}
let mut combined = Vec::new();
let mut start = 0;
while start < files.len() {
let mut end = start;
let mut chunk_chars = 0usize;
while end < files.len() {
let len = files[end].len() + 1;
if end > start && chunk_chars + len > MAX_PATH_ARGS_CHARS {
break;
}
chunk_chars += len;
end += 1;
}
let chunk = &files[start..end];
let mut args = Vec::with_capacity(base_args.len() + chunk.len() + 1);
args.extend(base_args.iter().map(OsString::from));
args.push(OsString::from("--"));
args.extend(files.iter().map(OsString::from));
run_git(repo, args)
args.extend(chunk.iter().map(OsString::from));
combined.extend(run_git(repo, args)?);
start = end;
}
Ok(combined)
}
fn run_git_with_paths_cancellable(