← All procedures

git.stash.import

Import stash from patch

CLI
Package
@procedures/git · README
Path
["git","stash","import"]
CLI
mark git stash import --patch <string>
As data
{"$proc":["git","stash","import"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","stash","import"], { patch: "<patch>" });
console.log(JSON.stringify(result));

From the command line

$ mark git stash import --patch <string>

As data, in a program

{ "$proc": ["git", "stash", "import"], "input": { "patch": "<patch>" } }

Input

FieldTypeRequiredDefaultDescription
patchstringyesPatch content to apply and stash
messagestringnoMessage for the new stash
includeUntrackedbooleannoInclude untracked files (default: false)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
importedbooleanyesTrue when the import succeeded
refstringnoThe new stash reference
errorstringnoWhy the import failed
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "patch": {
        "type": "string",
        "description": "Patch content to apply and stash"
      },
      "message": {
        "description": "Message for the new stash",
        "type": "string"
      },
      "includeUntracked": {
        "description": "Include untracked files (default: false)",
        "type": "boolean"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      }
    },
    "required": [
      "patch"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "imported": {
        "type": "boolean",
        "description": "True when the import succeeded"
      },
      "ref": {
        "description": "The new stash reference",
        "type": "string"
      },
      "error": {
        "description": "Why the import failed",
        "type": "string"
      }
    },
    "required": [
      "imported"
    ],
    "additionalProperties": {}
  }
}