204 Commits

Author SHA1 Message Date
Xu Cheng
cfc5fed7ce update: fix fork bomb caused by brew update --help
Fixes Homebrew/homebrew#49334.

Closes Homebrew/homebrew#49343.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-19 17:28:37 +08:00
ilovezfs
8e6c3ab039 update: always checkout master.
This should help to prevent situations where a user accidentally ends up
"stranded" in a branch indefinitely.

Additionally, the stash is never popped automatically at the end of a
successful update, but the stash-pop message is printed if something is
stashed.

When an interrupt occurs, the original behavior is still in place
(switch back to the old branch and revision, and pop the stash), though
this could be changed as well.

This commit modifies the behavior of both `brew update` and
"update-bash.sh" in the manner described above.

The idea for this approach is from Mike McQuaid.

Issue Homebrew/homebrew#48812

Closes Homebrew/homebrew#48993.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-18 10:44:14 +00:00
Mike McQuaid
3ac1c7b653 update: use GitHub API to avoid unneeded fetches.
Check to see if `HEAD` is the same as what we have locally. If it is:
don't bother to `git fetch`.

Closes Homebrew/homebrew#47888.

Closes Homebrew/homebrew#49219.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-18 10:43:10 +00:00
Mike McQuaid
775c4eedd7 Promote update-bash to the default updater.
Also, rename the existing updater to `update-ruby` to allow using as
a fallback. It will eventually be removed.

Closes Homebrew/homebrew#49109.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-15 08:54:03 +00:00