Pārlūkot izejas kodu

default to pushing local active branch. Fixes #846

Jelmer Vernooij 4 gadi atpakaļ
vecāks
revīzija
797329ddcf
2 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 3 0
      NEWS
  2. 2 0
      dulwich/porcelain.py

+ 3 - 0
NEWS

@@ -1,5 +1,8 @@
 0.20.21	UNRELEASED
 
+ * In porcelain.push, default to local active branch.
+   (Jelmer Vernooij, #846)
+
 0.20.20	2021-03-03
 
  * Implement ``Stash.drop``. (Peter Rowlands)

+ 2 - 0
dulwich/porcelain.py

@@ -1065,6 +1065,8 @@ def push(
 
     # Open the repo
     with open_repo_closing(repo) as r:
+        if refspecs is None:
+            refspecs = [active_branch(r)]
         (remote_name, remote_location) = get_remote_repo(r, remote_location)
 
         # Get the client and path