Bläddra i källkod

Add stash_drop().

Jelmer Vernooij 3 år sedan
förälder
incheckning
d8f0320497
1 ändrade filer med 10 tillägg och 1 borttagningar
  1. 10 1
      dulwich/porcelain.py

+ 10 - 1
dulwich/porcelain.py

@@ -1809,7 +1809,7 @@ def stash_push(repo):
 
 
 def stash_pop(repo, index):
-    """Pop a new stash from the stack."""
+    """Pop a stash from the stack."""
     with open_repo_closing(repo) as r:
         from dulwich.stash import Stash
 
@@ -1817,6 +1817,15 @@ def stash_pop(repo, index):
         stash.pop(index)
 
 
+def stash_drop(repo, index):
+    """Drop a stash from the stack."""
+    with open_repo_closing(repo) as r:
+        from dulwich.stash import Stash
+
+        stash = Stash.from_repo(r)
+        stash.drop(index)
+
+
 def ls_files(repo):
     """List all files in an index."""
     with open_repo_closing(repo) as r: