code: func (c *capturer) handleBranchDir(dirname string) error {
  	files, err := c.readDir(dirname)
  	if err != nil {
  
  		return err
  	}
  
  	var (
  		dirType bundleDirType
  	)
  
  	for _, fi := range files {
  		if !fi.IsDir() {
  			tp, _ := classifyBundledFile(fi.RealName())
  			if dirType == bundleNot {
  				dirType = tp
  			}
  
  			if dirType == bundleLeaf {
  				return c.handleDir(dirname)
  			}
  		}
  	}
  
  	if dirType != bundleBranch {
  		return c.handleDir(dirname)
  	}
  
  	dirs := newBundleDirs(bundleBranch, c)
  
  	var secondPass []*fileInfo
  
  	// Handle potential bundle headers first.
  	for _, fi := range files {
  		if fi.IsDir() {
  			continue
  		}
  
  		tp, isContent := classifyBundledFile(fi.RealName())
  
  		f, active := c.newFileInfo(fi, tp)
  
  		if !active {
  			continue
  		}
  
  		if !f.isOwner() {
  			if !isContent {
  				// This is a partial update -- we only care about the files that
  				// is in this bundle.
  				secondPass = append(secondPass, f)
  			}
  			continue
  		}
  		dirs.addBundleHeader(f)
  	}
  
  	for _, f := range secondPass {
  		dirs.addBundleFiles(f)
  	}
  
  	c.handler.handleBundles(dirs)
  
  	return nil
  
  }
docs: // This handles a bundle branch and its resources only. This is used
  // in server mode on changes. If this dir does not (anymore) represent a bundle
  // branch, the handling is upgraded to the full handleDir method.