Skip to content

Commit

Permalink
Merge pull request withfig#224 from withfig/feat/suggest_changed_file…
Browse files Browse the repository at this point in the history
…s_to_git_diff

feat: add changed files generator
  • Loading branch information
cstrnt authored May 25, 2021
2 parents e53fb4f + 68a2e37 commit 6e95369
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dev/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ const gitGenerators: Record<string, Fig.Generator> = {
});
},
},
getUnstagedFiles: {
script: "git diff --name-only",
splitOn: "\n",
},
};

const head = {
Expand Down Expand Up @@ -1268,7 +1272,7 @@ export const completionSpec: Fig.Spec = {
name: "commit",
isOptional: true,
suggestions: [{ name: "HEAD" }],
generators: gitGenerators.commits,
generators: [gitGenerators.commits, gitGenerators.getUnstagedFiles],
},
},
{
Expand Down

0 comments on commit 6e95369

Please sign in to comment.