set_new_commits
echo "$new_commits" | git rev-list --reverse --stdin | while read commit ; do
if [[ $(grep "$commit" "$GIT_DIR/commitnumbers" 2>/dev/null) == "" ]] ; then
- with_lock "$GIT_DIR/commitnumbers.lock" 'echo "$commit" >> "$GIT_DIR/commitnumbers"'
+ with_lock "$GIT_DIR/commitnumbers.lock" 'echo "$commit $refname" >> "$GIT_DIR/commitnumbers"'
number=$(grep --max-count=1 --line-number "$commit" "$GIT_DIR/commitnumbers" | grep -oP "^\d+(?=:)")
git tag "r/$number" "$commit"
fi
test "$(git rev-parse HEAD)" = "$(git rev-parse r/1)"
test "$(git describe --tags)" = "r/1"
+ test "$(git rev-parse HEAD) refs/heads/master" = "$(cat server/.git/commitnumbers)"
'
test_expect_success 'assign two new commits' '