Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions commit-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ cd "$WORKDIR"

# createCommitOnBranch commits onto a branch that already exists; it cannot
# create one, because a branch needs a commit and this is how commits are made.
# The old git-push path bootstrapped a missing branch with `git init`, and that
# is the one thing lost here. Both state branches have existed since the
# archive did, so this fires only if one is deleted -- in which case the fix is
# to recreate it deliberately, not to have a workflow guess at its contents.
# Bootstrapping a missing branch is deliberately not done here: this fires only
# if a state branch is deleted, and the fix then is to recreate it deliberately
# rather than have a workflow guess at its contents.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
log "FATAL: $WORKDIR is not a checkout of $BRANCH."
log " The branch has to exist before anything can be committed to it."
Expand Down
8 changes: 4 additions & 4 deletions tests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ echo "an HTTP failure reports what GitHub said, not just curl's exit code"
git -c user.name=t -c user.email=t@example.invalid commit -qm base
printf 'two\n' > keep.txt

# curl as --fail-with-body behaves on an HTTP error: the body is written
# to the output AND the exit status is non-zero. That combination is what
# used to lose the message -- set -e took the exit before anything printed
# the body, and the trap then deleted the file.
# curl as --fail-with-body behaves on an HTTP error: the body is written to
# the output AND the exit status is non-zero. That combination loses the
# message unless it is handled -- set -e takes the exit before anything
# prints the body, and the trap then deletes the file.
mkdir -p "$work/bin"
cat > "$work/bin/curl" <<'FAKE'
#!/bin/sh
Expand Down