Brew Cask Error

While trying to update HomeBrew but I got the following error message:

$ brew update; brew upgrade; brew cleanup
Error: homebrew-cask is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-cask. We don't do this for you automatically to avoid
repeatedly performing an expensive unshallow operation in CI systems (which
should instead be fixed to not use shallow clones). Sorry for the inconvenience!
Error: homebrew-cask is a shallow clone. To `brew update` first run:
git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-cask. We don't do this for you automatically to avoid
repeatedly performing an expensive unshallow operation in CI systems (which
should instead be fixed to not use shallow clones). Sorry for the inconvenience!

The solution to this problem requires the execution of the following two commands:

    $ brew untap homebrew/cask
    Untapping homebrew/cask...
    Untapped 1 command and 3752 casks (4,138 files, 176.0MB).
    $ brew tap homebrew/cask
    ...