From 6b1e7305c6f52705f817a024df136935ca88fa07 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 21 Nov 2026 22:34:49 +0000 Subject: pkgs/claude-inbox: is_repo from .git/config, without git A BRANCH without REPO is looked for in every repository in DIR, and is_repo ran git remote get-url for each, which adds up with hundreds (~0.4s for 300); [remote "claude"] in .git/config does it without git, but where .git isn't a directory. --- pkgs/claude-inbox.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/claude-inbox.nix b/pkgs/claude-inbox.nix index 698f2c6..6e0dd6e 100644 --- a/pkgs/claude-inbox.nix +++ b/pkgs/claude-inbox.nix @@ -142,6 +142,15 @@ let # there (but master, which is no branch to show or take) is_repo() { case $1 in "" | . | .. | */*) return 1 ;; esac + # [remote "claude"] in .git/config, without running git (with many + # repositories, it adds up), but where .git isn't a directory + local l + if test -d "$src/$1/.git"; then + while IFS= read -r l; do + case $l in *'[remote "claude"]'*) return 0 ;; esac + done 2>/dev/null < "$src/$1/.git/config" || : + return 1 + fi test -e "$src/$1/.git" && git -C "$src/$1" remote get-url claude >/dev/null 2>&1 } has_branch() { -- cgit v1.3.1