]> git.phdru.name Git - dotfiles.git/commitdiff
.shellrc: declare a variable local instead of unsetting it
authorOleg Broytman <phd@phdru.name>
Wed, 13 Jul 2016 04:56:39 +0000 (07:56 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 13 Jul 2016 04:56:39 +0000 (07:56 +0300)
.shellrc

index 1415c42e7a6a77393b3069e5f721ba957665a7bf..f027cc123032170fbbf361827660a1c3eba6cb66 100644 (file)
--- a/.shellrc
+++ b/.shellrc
@@ -171,12 +171,12 @@ if test -n "$BASH_VERSION"; then
    # list remotes with URLs matching a regexp
    list_remotes() {
       GIT_REMOTES=""
+      local remote
       for remote in `git remote`; do
          if git config --get remote.$remote.url | grep -q "$1"; then
             GIT_REMOTES="$GIT_REMOTES $remote"
          fi
       done
-      unset remote
    }
 
    # completion for cdremote - list remotes with directories as URLs