[srccommit] Fix server branch revision numbers
The previous change to add the -a
option to srcccommit changed the way we
count the number of revisions on a branch since the branch point to use HEAD
rather than the branch name. This is useful for example when using srccommit
to update VersionNum
files when doing an interactive rebase on a development
machine, since the branch tag isn't moved until the end of the rebase.
However, this change broke the use of srccommit from within a
git filter-branch
command, which is how the post-merge hook script operates,
because in this case, uniquely, HEAD does not reflect the working directory
currently being operated on. Change the code to select HEAD
or $branch
depending on whether the -b
switch is in use.
Just as well nobody has done any work on branches recently...