diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-12-10 20:41:22 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-12-10 20:41:22 -0600 |
commit | 2d70ee9886da7eac133ca5484e400f009894aa11 (patch) | |
tree | 4decebec51e4fda394209a47f48bf0dc54c4d6b4 /bashrc | |
parent | 5139c12d542c9697b8c79149c4d9738744c7c30a (diff) | |
download | conf-2d70ee9886da7eac133ca5484e400f009894aa11.tar.gz conf-2d70ee9886da7eac133ca5484e400f009894aa11.zip |
allow for divergent commits
Diffstat (limited to 'bashrc')
-rw-r--r-- | bashrc | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -241,8 +241,10 @@ function _set_vcs { git_base=$(git merge-base HEAD origin/$vcs_branch) if [[ "${git_base}" == "$(git rev-parse HEAD)" ]]; then vcs_local_commits="-$(git rev-list HEAD..origin/$vcs_branch | wc -l)" - else + elif [[ "${git_base}" == "$(git rev-parse origin/$vcs_branch)" ]]; then vcs_local_commits="+$(git rev-list origin/${vcs_branch}..HEAD | wc -l)" + else + vcs_local_commits="+$(git rev-list ${git_base}..HEAD | wc -l)-$(git rev-list ${git_base}..origin/$vcs_branch | wc -l)" fi fi if [[ -e "${git_dir}/MERGE_HEAD" ]]; then |