UNPKG

301 BJavaScriptView Raw
1'use strict'
2
3const execGit = require('./execGit')
4
5module.exports = async function getStagedFiles(options) {
6 try {
7 const lines = await execGit(['diff', '--staged', '--diff-filter=ACM', '--name-only'], options)
8 return lines ? lines.split('\n') : []
9 } catch (error) {
10 return null
11 }
12}