pub fn add_all<T: ToCStr>(&mut self,
                              pathspecs: &[T],
                              flag: IndexAddOption,
                              mut cb: Option<IndexMatchedPath>)
                              -> Result<(), Error> {
        let arr = pathspecs.iter().map(|t| t.to_c_str()).collect::<Vec<CString>>();
        let strarray = arr.iter().map(|c| c.as_ptr())
                          .collect::<Vec<*const libc::c_char>>();
        let ptr = cb.as_mut();
        let raw_strarray = raw::git_strarray {
            strings: strarray.as_ptr() as *mut _,
            count: strarray.len() as libc::size_t,
        };
        let callback = ptr.as_ref().map(|_| index_matched_path_cb);
        unsafe {
            try_call!(raw::git_index_add_all(self.raw,
                                             &raw_strarray,
                                             flag.bits() as libc::c_uint,
                                             callback,
                                             ptr.map(|p| p as *mut _)
                                                .unwrap_or(0 as *mut _)
                                                    as *mut libc::c_void));
        }
        return Ok(());
    }
/// Add or update index entries matching files in the working directory.
///
/// This method will fail in bare index instances.
///
/// The `pathspecs` are a list of file names or shell glob patterns that
/// will matched against files in the repository's working directory. Each
/// file that matches will be added to the index (either updating an
/// existing entry or adding a new entry). You can disable glob expansion
/// and force exact matching with the `AddDisablePathspecMatch` flag.
///
/// Files that are ignored will be skipped (unlike `add_path`). If a file is
/// already tracked in the index, then it will be updated even if it is
/// ignored. Pass the `AddForce` flag to skip the checking of ignore rules.
///
/// To emulate `git add -A` and generate an error if the pathspec contains
/// the exact path of an ignored file (when not using `AddForce`), add the
/// `AddCheckPathspec` flag. This checks that each entry in `pathspecs`
/// that is an exact match to a filename on disk is either not ignored or
/// already in the index. If this check fails, the function will return
/// an error.
///
/// To emulate `git add -A` with the "dry-run" option, just use a callback
/// function that always returns a positive value. See below for details.
///
/// If any files are currently the result of a merge conflict, those files
/// will no longer be marked as conflicting. The data about the conflicts
/// will be moved to the "resolve undo" (REUC) section.
///
/// If you provide a callback function, it will be invoked on each matching
/// item in the working directory immediately before it is added to /
/// updated in the index. Returning zero will add the item to the index,
/// greater than zero will skip the item, and less than zero will abort the
/// scan an return an error to the caller.
Add or update index entries matching files in the working directory.
This method will fail in bare index instances.

The `pathspecs` are a list of file names or shell glob patterns that
will matched against files in the repository's working directory. Each
file that matches will be added to the index (either updating an
existing entry or adding a new entry). You can disable glob expansion
and force exact matching with the `AddDisablePathspecMatch` flag.

Files that are ignored will be skipped (unlike `add_path`). If a file is
already tracked in the index, then it will be updated even if it is
ignored. Pass the `AddForce` flag to skip the checking of ignore rules.



To emulate `git add -A` with the "dry-run" option, just use a callback
function that always returns a positive value. See below for details.

If any files are currently the result of a merge conflict, those files
will no longer be marked as conflicting. The data about the conflicts
will be moved to the "resolve undo" (REUC) section.

If you provide a callback function, it will be invoked on each matching
item in the working directory immediately before it is added to
updated in the index. Returning zero will add the item to the index,
greater than zero will skip the item, and less than zero will abort the
scan an return an error to the caller.
Add or update index entries matching files in the working directory . This method will fail in bare index instances . The ` pathspecs ` are a list of file names or shell glob patterns that will matched against files in the repository ' s working directory . Each file that matches will be added to the index ( either updating an existing entry or adding a new entry ) . You can disable glob expansion and force exact matching with the ` AddDisablePathspecMatch ` flag . Files that are ignored will be skipped ( unlike ` add_path ` ) . If a file is already tracked in the index then it will be updated even if it is ignored . Pass the ` AddForce ` flag to skip the checking of ignore rules . To emulate ` git add - A ` with the " dry - run " option just use a callback function that always returns a positive value . See below for details . If any files are currently the result of a merge conflict those files will no longer be marked as conflicting . The data about the conflicts will be moved to the " resolve undo " ( REUC ) section . If you provide a callback function it will be invoked on each matching item in the working directory immediately before it is added to updated in the index . Returning zero will add the item to the index greater than zero will skip the item and less than zero will abort the scan an return an error to the caller .
pub fn add_all<T: ToCStr>(&mut self,
                              pathspecs: &[T],
                              flag: IndexAddOption,
                              mut cb: Option<IndexMatchedPath>)
                              -> Result<(), Error> {
        let arr = pathspecs.iter().map(|t| t.to_c_str()).collect::<Vec<CString>>();
        let strarray = arr.iter().map(|c| c.as_ptr())
                          .collect::<Vec<*const libc::c_char>>();
        let ptr = cb.as_mut();
        let raw_strarray = raw::git_strarray {
            strings: strarray.as_ptr() as *mut _,
            count: strarray.len() as libc::size_t,
        };
        let callback = ptr.as_ref().map(|_| index_matched_path_cb);
        unsafe {
            try_call!(raw::git_index_add_all(self.raw,
                                             &raw_strarray,
                                             flag.bits() as libc::c_uint,
                                             callback,
                                             ptr.map(|p| p as *mut _)
                                                .unwrap_or(0 as *mut _)
                                                    as *mut libc::c_void));
        }
        return Ok(());
    }
pub fn add_all < T : ToCStr > ( & mut self , pathspecs : & [ T ] , flag : IndexAddOption , mut cb : Option < IndexMatchedPath > ) -> Result < ( ) , Error > { let arr = pathspecs . iter ( ) . map ( | t | t . to_c_str ( ) ) . collect :: < Vec < CString > > ( ) ; let strarray = arr . iter ( ) . map ( | c | c . as_ptr ( ) ) . collect :: < Vec < * const libc :: c_char > > ( ) ; let ptr = cb . as_mut ( ) ; let raw_strarray = raw :: git_strarray { strings : strarray . as_ptr ( ) as * mut _ , count : strarray . len ( ) as libc :: size_t , } ; let callback = ptr . as_ref ( ) . map ( | _ | index_matched_path_cb ) ; unsafe { try_call ! ( raw git_index_add_all ( self raw raw_strarray flag bits ( ) as libc c_uint callback ptr map ( p p as mut ) unwrap_or ( 0 as mut ) as mut libc c_void ) ) ; } return Ok ( ( ) ) ; }
Add or update index entries matching files in the working directory.
Add or update index entries matching files in the working directory .
&mut self
pathspecs
&[T]
flag
IndexAddOption
cb
Option<IndexMatchedPath>
&mut self
pathspecs
&[T]
flag
IndexAddOption
cb
Option<IndexMatchedPath>