def update_wd_stacks!(pwd, oldpwd)
      @pwd_stack[0] ||= pwd
      @oldpwd_stack[0] ||= oldpwd unless oldpwd.to_s.empty?

      # We haven't changed working directories; short-circuit.
      return if pwd == @pwd_stack[-1]

      # If the current +pwd+ is identical to the top of the +@oldpwd_stack+ and
      # the current +oldpwd+ is identical to the second-to-top entry, then a
      # previous cd/pushd has been undone.
      if pwd == @oldpwd_stack[-1] && oldpwd == @oldpwd_stack[-2]
        @pwd_stack.pop
        @oldpwd_stack.pop
      else # New cd/pushd
        @pwd_stack << pwd
        @oldpwd_stack << oldpwd
      end
    end
def update_wd_stacks!(pwd, oldpwd)
      @pwd_stack[0] ||= pwd
      @oldpwd_stack[0] ||= oldpwd unless oldpwd.to_s.empty?

      # We haven't changed working directories; short-circuit.
      return if pwd == @pwd_stack[-1]

      # If the current +pwd+ is identical to the top of the +@oldpwd_stack+ and
      # the current +oldpwd+ is identical to the second-to-top entry, then a
      # previous cd/pushd has been undone.
      if pwd == @oldpwd_stack[-1] && oldpwd == @oldpwd_stack[-2]
        @pwd_stack.pop
        @oldpwd_stack.pop
      else # New cd/pushd
        @pwd_stack << pwd
        @oldpwd_stack << oldpwd
      end
    end
Updates the stacks that track the history of values for +PWD+ and
 +OLDPWD+
 @param [Pathname] pwd     expanded +PWD+
 @param [Pathname] oldpwd  expanded +OLDPWD+
 @return [void]