diff options
| author | Jack Nagel | 2012-06-03 10:24:17 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-06-03 10:32:40 -0500 |
| commit | 65bea86ae9df1b58d88ad32e7338b1d1c8ca4e0e (patch) | |
| tree | b7a4717292684c49bd0432263ff10ad0d44ecb40 /Library | |
| parent | 7af4622b0f06d0f505f4e57ea4f65b6e8626e2cc (diff) | |
| download | brew-65bea86ae9df1b58d88ad32e7338b1d1c8ca4e0e.tar.bz2 | |
doctor: improve outdated Homebrew check
We now skip the outdated check if our local origin/master tracking
branch matches the origin remote's current master. This prevents false
positives when we are actually up-to-date but the latest commit is over
24 hours old.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index f76eef0b6..f22e57e92 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -835,6 +835,12 @@ end def check_for_outdated_homebrew HOMEBREW_REPOSITORY.cd do + if File.directory? ".git" + local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp + remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master`)[0] + return if local == remote + end + timestamp = if File.directory? ".git" `git log -1 --format="%ct" HEAD`.to_i else |
