summaryrefslogtreecommitdiff
path: root/skills/executing-plans/scripts/task-done
diff options
context:
space:
mode:
Diffstat (limited to 'skills/executing-plans/scripts/task-done')
-rwxr-xr-xskills/executing-plans/scripts/task-done7
1 files changed, 5 insertions, 2 deletions
diff --git a/skills/executing-plans/scripts/task-done b/skills/executing-plans/scripts/task-done
index e5fc6a9..d6400b4 100755
--- a/skills/executing-plans/scripts/task-done
+++ b/skills/executing-plans/scripts/task-done
@@ -20,7 +20,10 @@ base=$3
shift 4
sdd="$(cd "$(dirname "$0")/../../subagent-driven-development/scripts" && pwd)"
-git rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; }
+# The repository the workspace and ledger belong to (see sdd-repo); BASE and
+# HEAD are read there, not in the bare cwd.
+repo=$("${BASH:-bash}" "$sdd/sdd-repo" --with-commit)
+git -C "$repo" rev-parse --verify --quiet "$base" >/dev/null || { echo "bad BASE: $base" >&2; exit 2; }
dir=$("$sdd/sdd-workspace" "$plan")
log="$dir/task-${n}-tests.log"
@@ -47,6 +50,6 @@ fi
last=$(grep -v '^[[:space:]]*$' "$log" | tail -n 1) || last="(no output)"
[ -f "$ledger" ] || printf '# SDD ledger — plan: %s\n' "$plan" > "$ledger"
-line="Task $n: complete (commits $(git rev-parse --short=7 "$base")..$(git rev-parse --short=7 HEAD), tests: $cmd → $last)"
+line="Task $n: complete (commits $(git -C "$repo" rev-parse --short=7 "$base")..$(git -C "$repo" rev-parse --short=7 HEAD), tests: $cmd → $last)"
printf '%s\n' "$line" >> "$ledger"
echo "ledger: $line"