+ local directory="$1"; shift
+ pushd "$directory" &>/dev/null
+ exit_on_error "changing to directory: $directory"
+
+ if [ ! -d ".git" ]; then
+ # not a git project, so just boil this down to a getem action.
+ popd &>/dev/null
+ log_feisty_meow_event "skipping careful part and doing simple update on non-git repository: $directory"
+ do_revctrl_simple_update "$directory"
+ return $?
+ fi
+
+#hmmm: another piece of reusable code, to process the directory for printing.
+ # make a nice echoer since we want to use it inside conditions below.
+ local nicedir="$directory"
+ if [ $nicedir == "." ]; then
+ nicedir=$(\pwd)
+ fi
+ local blatt_report="echo -e \ncarefully retrieving '$nicedir'..."
+ $blatt_report
+
+ local this_branch="$(my_branch_name)"
+
+ show_branch_conditionally "$this_branch"
+
+ # first update all our remote branches to their current state from the repos.
+ git remote update | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git remote update"
+
+ show_branch_conditionally "$this_branch"
+
+ # this code is now doing what i have to do when i repair the repo. and it seems to be good so far.
+ # note that we allow the local branch to be merged with its remote counterpart; otherwise we would
+ # miss changes that happened elsewhere which should be seen in our local copy.
+ local branch_list=$(all_branch_names)
+ local bran
+ for bran in $branch_list; do
+ log_feisty_meow_event "synchronizing remote branch: $bran"
+ git checkout "$bran" | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git switching checkout to remote branch: $bran"
+
+ show_branch_conditionally "$this_branch"
+
+ remote_branch_info=$(git ls-remote --heads origin $bran 2>/dev/null)
+ if [ ! -z "$remote_branch_info" ]; then
+ # we are pretty sure the remote branch does exist.
+ git pull --tags origin "$bran" | $TO_SPLITTER
+ promote_pipe_return 0
+ fi
+ exit_on_error "git pull of remote branch: $bran"
+ done
+ # now switch back to our branch.
+ git checkout "$this_branch" | $TO_SPLITTER
+ promote_pipe_return 0
+ exit_on_error "git checking out our current branch: $this_branch"
+
+ # now pull down any changes in our own origin in the repo, to stay in synch
+ # with any changes from others.
+ git fetch --tags --all | $TO_SPLITTER
+#is the above really important when we did this branch already in the loop?
+#it does an --all, but is that effective or different? should we be doing that in above loop?
+ promote_pipe_return 0
+ exit_on_error "git pulling all upstream"
+
+ popd &>/dev/null