|
@@ -50,9 +50,7 @@ function _ruby_version() {
|
|
# use a neutral color, otherwise colors will vary according to time.
|
|
# use a neutral color, otherwise colors will vary according to time.
|
|
function _git_time_since_commit() {
|
|
function _git_time_since_commit() {
|
|
# Only proceed if there is actually a commit.
|
|
# Only proceed if there is actually a commit.
|
|
- if git log -1 > /dev/null 2>&1; then
|
|
|
|
- # Get the last commit.
|
|
|
|
- last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null)
|
|
|
|
|
|
+ if last_commit=$(git log --pretty=format:'%at' -1 2> /dev/null); then
|
|
now=$(date +%s)
|
|
now=$(date +%s)
|
|
seconds_since_last_commit=$((now-last_commit))
|
|
seconds_since_last_commit=$((now-last_commit))
|
|
|
|
|