(ref string, cached bool, paths []string)
| 267 | } |
| 268 | |
| 269 | func DiffIndexWithPaths(ref string, cached bool, paths []string) (string, error) { |
| 270 | args := []string{"diff-index"} |
| 271 | if cached { |
| 272 | args = append(args, "--cached") |
| 273 | } |
| 274 | args = append(args, ref) |
| 275 | args = append(args, "--") |
| 276 | args = append(args, paths...) |
| 277 | |
| 278 | output, err := gitSimple(args...) |
| 279 | if err != nil { |
| 280 | return "", err |
| 281 | } |
| 282 | |
| 283 | return output, nil |
| 284 | } |
| 285 | |
| 286 | func HashObject(r io.Reader) (string, error) { |
| 287 | cmd, err := gitNoLFS("hash-object", "--stdin") |