diff options
author | Michael Allen <michael@michaelallen.io> | 2015-02-11 23:39:19 +0000 |
---|---|---|
committer | Michael Allen <michael@michaelallen.io> | 2015-02-11 23:39:19 +0000 |
commit | 89fa3a5f520297bd353cd9720cc6d0d0e96a075a (patch) | |
tree | f135adf522dbd99bba868ba9f4da9803c8242298 /git-base.sh | |
parent | db4d3a9c42b788561bfd15d32a841cd1e8fd5a5f (diff) | |
download | git-sonar-89fa3a5f520297bd353cd9720cc6d0d0e96a075a.tar.gz git-sonar-89fa3a5f520297bd353cd9720cc6d0d0e96a075a.zip |
turning some tests into proper shunit tests and found a few bugs
Diffstat (limited to '')
-rwxr-xr-x | git-base.sh | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/git-base.sh b/git-base.sh index 5ed680d..39e7367 100755 --- a/git-base.sh +++ b/git-base.sh @@ -1,5 +1,3 @@ -set -e - dot_git="" cwd="" @@ -45,7 +43,7 @@ is_repo() { git_root() { if [ -d .git ]; then - echo "." + echo "$(pwd)" else echo "$(git rev-parse --show-toplevel 2>/dev/null)" fi @@ -72,10 +70,10 @@ time_to_update() { local timesincelastupdate="$(($(time_now) - $(timestamp)))" local fiveminutes="$((5 * 60))" if (( "$timesincelastupdate" > "$5minutes" )); then - # time to update return 0 (which is false) + # time to update return 0 (which is true) return 0 else - # not time to update return 1 (which is true) + # not time to update return 1 (which is false) return 1 fi else |