Make stgit.config use git-repo-config.
[stgit] / stgit / commands / pull.py
index 227249e..e47858a 100644 (file)
@@ -50,10 +50,12 @@ def func(parser, options, args):
     if len(args) > 2:
         parser.error('incorrect number of arguments')
 
-    repository = 'origin'
-    refspec = None
     if len(args) >= 1:
         repository = args[0]
+    else:
+        repository = config.get('branch.%s.remote' % git.get_head_file()) or 'origin'
+
+    refspec = None
     if len(args) == 2:
         refspec = args[1]
 
@@ -82,8 +84,7 @@ def func(parser, options, args):
         push_patches(applied, options.merged)
 
     # maybe tidy up
-    repack = config.get('stgit', 'keepoptimized')
-    if repack == 'yes':
+    if config.get('stgit.keepoptimized') == 'yes':
         git.repack()
 
     print_crt_patch()