// Add adds any number of files to git
172353
func (g *Git) Add(ctx context.Context, files ...string) error {
	if len(files) < 1 || (len(files) == 1 && files[0] == g.path) {
		return g.addAll()
	}
	for _, file := range files {
		if strings.HasPrefix(file, g.path) {
			file = strings.TrimPrefix(file, g.path+string(filepath.Separator))
		}
		_, err := g.wt.Add(file)
		if err != nil {
			return errors.Wrapf(err, "failed to add file '%s': %s", file, err)
		}
	}
	return nil
}
1013774
func (v Values) Add(key, value string) {
	v[key] = append(v[key], value)
}
1157041
func (c *Container) add(v uint16) (added bool) {

	if c.isArray() {
		added = c.arrayAdd(v)
	} else if c.isRun() {
		added = c.runAdd(v)
	} else {
		added = c.bitmapAdd(v)
	}
	if added {
		c.n++
	}
	return added
}
1250801
func (s *SyncedSet) Add(datas ...interface{}) {
	s.Lock()
	defer s.Unlock()
	for _, data := range datas {
		s.set[data] = true
	}
}
339675
func (h *HLLPP) Add(v []byte) {
	x := murmurSum64(v)

	if h.sparse {
		h.tmpSet = append(h.tmpSet, h.encodeHash(x))

		// is tmpSet >= 1/4 of memory limit?
		if 4*uint32(len(h.tmpSet))*8 >= 6*h.m/4 {
			h.flushTmpSet()
		}
	} else {
		idx := uint32(sliceBits64(x, 63, 64-h.p))
		rho := rho(x<<h.p | 1<<(h.p-1))
		h.updateRegisterIfBigger(idx, rho)
	}
}
2031
func (m *Migrations) Add(id int, stmts ...string) {
	*m = append(*m, Migration{ID: id, Stmts: stmts})
}
212734
func (t *StringTree) Add(o string) (val string, isDupe bool) {
	v, d := t.Tree.Add(o)
	if v != nil {
		return v.(string), d
	}
	return "", d
}
968846
func (hlm *hardlinkManager) Add(fi os.FileInfo, resource Resource) error {
	if _, ok := resource.(Hardlinkable); !ok {
		return errNotAHardLink
	}

	key, err := newHardlinkKey(fi)
	if err != nil {
		return err
	}

	hlm.hardlinks[key] = append(hlm.hardlinks[key], resource)

	return nil
}
400025
func (b *CumulativeBucket) Add(val int64) {
	r := &Result{}
	r.Add(val)
	b.MultiAdd(r)
}
376677
func (m *Map) Add(keys ...string) {
	for _, key := range keys {
		for i := 0; i < m.replicas; i++ {
			hash := int(m.hash([]byte(strconv.Itoa(i) + key)))
			m.keys = append(m.keys, hash)
			m.hashMap[hash] = key
		}
	}
	sort.Ints(m.keys)
}
1056679
func (b *UniqueFilesBacklog) Add(path string) {
	defer func() { b.empty = false }()
	if b.empty {
		b.next = path
		return
	}
	if path == b.next {
		return
	}
	b.rest[path] = struct{}{}
}
790500
func (c *Config) AddFile(path string, level ConfigLevel, force bool) error {
	cpath := C.CString(path)
	defer C.free(unsafe.Pointer(cpath))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_config_add_file_ondisk(c.ptr, cpath, C.git_config_level_t(level), nil, cbool(force))
	runtime.KeepAlive(c)
	if ret < 0 {
		return MakeGitError(ret)
	}

	return nil
}
846907
func (v *Index) Add(entry *IndexEntry) error {
	var centry C.git_index_entry

	populateCIndexEntry(entry, &centry)
	defer freeCIndexEntry(&centry)

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	err := C.git_index_add(v.ptr, &centry)
	runtime.KeepAlive(v)
	if err < 0 {
		return MakeGitError(err)
	}

	return nil
}
761981
func (m *indexFileMap) Add(sha string, index *indexFile) {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	pairKey := strings.Join([]string{sha, index.Name}, ":")
	if m.nameShaPairs[pairKey] {
		return
	}

	m.nameMap[sha] = append(m.nameMap[sha], index)
	m.nameShaPairs[pairKey] = true
}
98357
func (w *filePoller) Add(name string) error {
	w.mu.Lock()
	defer w.mu.Unlock()

	if w.closed {
		return errPollerClosed
	}

	f, err := os.Open(name)
	if err != nil {
		return err
	}
	fi, err := os.Stat(name)
	if err != nil {
		return err
	}

	if w.watches == nil {
		w.watches = make(map[string]chan struct{})
	}
	if _, exists := w.watches[name]; exists {
		return fmt.Errorf("watch exists")
	}
	chClose := make(chan struct{})
	w.watches[name] = chClose
	go w.watch(f, fi, chClose)
	return nil
}
1356449
func (f *Files) add(filename string, sf *staticFile) {
	if f.file == nil {
		f.file = make(map[string]*staticFile)
	}
	f.file[filename] = sf
}
1062665
func (g *Git) Push(ctx context.Context, remote, branch string) error {
	return g.PushPull(ctx, "push", remote, branch)
}