diff --git a/Library/Homebrew/cmd/update-reset.sh b/Library/Homebrew/cmd/update-reset.sh index 31bf279706..f279494f48 100644 --- a/Library/Homebrew/cmd/update-reset.sh +++ b/Library/Homebrew/cmd/update-reset.sh @@ -1,10 +1,11 @@ -#: * `update-reset`: -#: Fetches and resets Homebrew and all tap repositories using `git`(1) to -#: their latest `origin/master`. Note this will destroy all your uncommitted -#: or committed changes. +#: * `update-reset` []: +#: Fetches and resets Homebrew and all tap repositories (or the specified +#: `repositories`) using `git`(1) to their latest `origin/master`. Note this +#: will destroy all your uncommitted or committed changes. homebrew-update-reset() { local DIR + local -a REPOS=() for option in "$@" do @@ -15,10 +16,7 @@ homebrew-update-reset() { [[ "$option" = *d* ]] && HOMEBREW_DEBUG=1 ;; *) - odie <'. -EOS + REPOS+=("$option") ;; esac done @@ -28,7 +26,12 @@ EOS set -x fi - for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/* + if [[ -z "$REPOS" ]] + then + REPOS+=("$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*) + fi + + for DIR in ${REPOS[@]} do [[ -d "$DIR/.git" ]] || continue cd "$DIR" || continue diff --git a/docs/Manpage.md b/docs/Manpage.md index 79e01dfbe1..8491b4f994 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -578,10 +578,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note If `--force` (or `-f`) is specified then always do a slower, full update check even if unnecessary. - * `update-reset`: - Fetches and resets Homebrew and all tap repositories using `git`(1) to - their latest `origin/master`. Note this will destroy all your uncommitted - or committed changes. + * `update-reset` [`repositories`]: + Fetches and resets Homebrew and all tap repositories (or the specified + `repositories`) using `git`(1) to their latest `origin/master`. Note this + will destroy all your uncommitted or committed changes. * `upgrade` [`install-options`] [`--cleanup`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [`formulae`]: Upgrade outdated, unpinned brews (with existing install options). diff --git a/manpages/brew.1 b/manpages/brew.1 index 67eb139faf..4bdb289350 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -527,7 +527,7 @@ If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full update check even if unnecessary\. . .IP "\(bu" 4 -\fBupdate\-reset\fR: Fetches and resets Homebrew and all tap repositories using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. +\fBupdate\-reset\fR [\fIrepositories\fR]: Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\. . .IP "\(bu" 4 \fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-cleanup\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-display\-times\fR] [\fIformulae\fR]: Upgrade outdated, unpinned brews (with existing install options)\.