ek9_git_add

Reports stagedPaths and stagedPathCount (what this call staged), then indexAfter and indexAfterCount (everything now staged) and a summary line.

Category: Execution · Compare: git add / Stage Changes

When to use it

'Stage these files for the next commit' - one call with paths:[...] or all:true; the first step of stage, commit, push. Staging copies the CURRENT content, so edits made afterwards need staging again.

When not to use it

Details

stagedPaths / stagedPathCount are what THIS call staged; indexAfter / indexAfterCount are the whole index afterwards, so one call can never be read as having staged the earlier entries. At least one of paths / all is required; a path outside the workspace, a path git cannot find, or a non-git workspace is refused with the route in nextStep.

Arguments

ArgumentTypeRequiredWhat it is
allbooleanStage every change including deletions (git add -A). Default false.
pathsarray of stringWorkspace-relative paths to stage.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it.

Named path into existing index

Request

{
  "paths" : [ "new.txt" ]
}

Response

{
  "all" : false,
  "indexAfter" : [ "new.txt", "tracked.txt" ],
  "indexAfterCount" : 2,
  "meta" : {
    "serverMs" : "<timing>"
  },
  "stagedPathCount" : 1,
  "stagedPaths" : [ "new.txt" ],
  "status" : "staged",
  "summary" : "Staged 1 path; the index now holds 2 paths",
  "written" : true
}