]> git.droids-corp.org - git-central.git/commitdiff
Store the branch name for the lulz.
authorStephen Haberman <stephen@exigencecorp.com>
Fri, 3 Oct 2008 06:29:42 +0000 (01:29 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Fri, 10 Oct 2008 17:07:10 +0000 (12:07 -0500)
server/post-receive-assign-commit-numbers
tests/t3200-server-post-receive-assign-commit-numbers.sh

index 39c3f485935be52e3f09a3ce3de6271f925569b4..364618b11ac39527689f7a8659190ea04ff11571 100644 (file)
@@ -6,7 +6,7 @@ while read oldrev newrev refname ; do
        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
index 4f8f9248c8ad39777a6794a97db27a5d57ab9e95..b4cdac3018fc7631dda212364793493ec6952868 100644 (file)
@@ -27,6 +27,7 @@ test_expect_success 'assign one new commit' '
 
        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' '