浏览代码

default to pushing local active branch. Fixes #846

Jelmer Vernooij 4 年之前
父节点
当前提交
797329ddcf
共有 2 个文件被更改,包括 5 次插入0 次删除
  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