added index vs working dir detection; other gawk fixes

It now detects the changes in the working directory and the index.
If there are changes in the working directory, it puts an * before
the branch name. If there are changes in the index, it puts an *
after the branch name.

There was also a fix to only match the 1st rule when there is no
upstream branch.