Fix exception error message in git.merge()
[stgit] / stgit / git.py
index df3adad..d5bd724 100644 (file)
@@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 """
 
-import sys, os, glob, popen2
+import sys, os, popen2
 
 from stgit.utils import *
 
@@ -296,6 +296,8 @@ def create_branch(new_branch, tree_id = None):
 def switch_branch(name):
     """Switch to a git branch
     """
+    global __head
+
     new_head = os.path.join('refs', 'heads', name)
     if not branch_exists(new_head):
         raise GitException, 'Branch "%s" does not exist' % name
@@ -359,11 +361,6 @@ def add(names):
 def rm(files, force = False):
     """Remove a file from the repository
     """
-    if force:
-        git_opt = '--force-remove'
-    else:
-        git_opt = '--remove'
-
     if not force:
         for f in files:
             if os.path.exists(f):
@@ -467,7 +464,7 @@ def merge(base, head1, head2):
 
     # this can fail if there are conflicts
     if os.system('git-merge-index -o -q gitmergeonefile.py -a') != 0:
-        raise GitException, 'git-merge-cache failed (possible conflicts)'
+        raise GitException, 'git-merge-index failed (possible conflicts)'
 
 def status(files = [], modified = False, new = False, deleted = False,
            conflict = False, unknown = False, noexclude = False):