diff options
author | m0viefreak <m0viefreak.cm@googlemail.com> | 2013-07-20 18:31:46 +0400 |
---|---|---|
committer | m0viefreak <m0viefreak.cm@googlemail.com> | 2013-07-20 18:42:33 +0400 |
commit | 558269dabdf30092e1ada2c2dd3c56358de7b707 (patch) | |
tree | 405893bf33999c50806f3508f47d42e46836a4da /version.sh | |
parent | be96cdcbb893bd5c991bc604b4c90bb10255c553 (diff) |
version.sh: simplify an unused if/else
base is only needed in the case where the current branch is not master
Diffstat (limited to 'version.sh')
-rw-r--r-- | version.sh | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/version.sh b/version.sh index 3cc2b2095..1527b1969 100644 --- a/version.sh +++ b/version.sh @@ -31,13 +31,11 @@ if ! git rev-parse --git-dir > /dev/null 2>&1; then else # Get the current branch name branch=$(git symbolic-ref -q HEAD) && branch=${branch##refs/heads/} || branch="no branch" - # If we are on the master branch - if [[ "$branch" == "master" ]]; then - base="HEAD" + # If we are on another branch that isn't master, we want extra info like on # which commit from master it is based on and what its hash is. This assumes we # won't ever branch from a changeset from before the move to git - else + if [[ "$branch" != "master" ]]; then # Get where the branch is based on master base=$(git merge-base master HEAD) base_ver=$(git rev-list --count $svnhash..$base) |