summaryrefslogtreecommitdiff
path: root/morphlib/plugins/push_pull_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'morphlib/plugins/push_pull_plugin.py')
-rw-r--r--morphlib/plugins/push_pull_plugin.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/morphlib/plugins/push_pull_plugin.py b/morphlib/plugins/push_pull_plugin.py
index 843de1a6..8546e2bf 100644
--- a/morphlib/plugins/push_pull_plugin.py
+++ b/morphlib/plugins/push_pull_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Codethink Limited
+# Copyright (C) 2014-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -10,8 +10,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# with this program. If not, see <http://www.gnu.org/licenses/>.
import cliapp
import logging
@@ -52,7 +51,7 @@ class PushPullPlugin(cliapp.Plugin):
if len(args) != 2:
raise morphlib.Error('push must get exactly two arguments')
- gd = morphlib.gitdir.GitDirectory(os.getcwd())
+ gd = morphlib.gitdir.GitDirectory(os.getcwd(), search_for_root=True)
remote, branch = args
rs = morphlib.gitdir.RefSpec(branch)
gd.get_remote(remote).push(rs)
@@ -81,7 +80,7 @@ class PushPullPlugin(cliapp.Plugin):
if len(args) > 1:
raise morphlib.Error('pull takes at most one argument')
- gd = morphlib.gitdir.GitDirectory(os.getcwd())
+ gd = morphlib.gitdir.GitDirectory(os.getcwd(), search_for_root=True)
remote = gd.get_remote('origin')
if args:
branch = args[0]