Fix off-by-one in file path parsing for first uncommitted file

stdout.trim() was stripping the leading space from the first line of
git status --porcelain output, causing substring(3) to index one char
into the filename. Switch to trimEnd() to only strip trailing newlines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
kry-kylewhittle 2026-06-16 09:27:37 +01:00
parent da938de175
commit fd2818ad56
3 changed files with 3 additions and 3 deletions

View file

@ -121,7 +121,7 @@ function errorMessage(e: unknown): string {
async function gitExec(repoPath: string, args: string): Promise<string> {
const { stdout } = await execAsync(`git -C "${repoPath}" ${args}`);
return stdout.trim();
return stdout.trimEnd();
}
function parseChangedFiles(porcelain: string): ChangedFile[] {

View file

@ -1,7 +1,7 @@
{
"id": "github-repo-tools",
"name": "GitHub Repo Tools",
"version": "1.0.1",
"version": "1.0.2",
"minAppVersion": "1.7.2",
"description": "Monitor a GitHub repo — staleness alerts, PR dashboard, and activity notifications.",
"author": "Kyle Whittle",

View file

@ -1,6 +1,6 @@
{
"name": "obsidian-github-tools",
"version": "1.0.1",
"version": "1.0.2",
"description": "GitHub wiki repo monitor for Obsidian",
"main": "main.js",
"scripts": {