chiark / gitweb /
Let some commands work with detached HEAD
authorKarl Hasselström <kha@treskal.com>
Mon, 8 Oct 2007 03:52:06 +0000 (05:52 +0200)
committerKarl Hasselström <kha@treskal.com>
Thu, 8 Nov 2007 08:57:49 +0000 (09:57 +0100)
add, resolved, and status didn't use the crt_series that was
initialized for them. So don't initialize it, since that means (1)
less work and (2) they won't fail when HEAD is detached.

Note that this doesn't completely fix the problem with detached HEAD:
a number of other commands (e.g. branch) don't always need to refer to
a current series, but currently fails on a detached HEAD even in those
situations.

Signed-off-by: Karl Hasselström <kha@treskal.com>
stgit/commands/add.py
stgit/commands/resolved.py
stgit/commands/status.py

index 264ab9ffb53b38a9978e80ee6d88dc3fd05b6fbf..ceea188def059d2e85646a33f8b718e71961fdea 100644 (file)
@@ -31,7 +31,7 @@ Add the files or directories passed as arguments to the
 repository. When a directory name is given, all the files and
 subdirectories are recursively added."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = []
 
 
index 236ffd74e9ab9caf52a143cfac415347d7b01df2..011db9133a5f77912ccae79527295e96f11ba22f 100644 (file)
@@ -34,7 +34,7 @@ Mark a merge conflict as resolved. The conflicts can be seen with the
 'C'. This command also removes any <file>.{ancestor,current,patched}
 files."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-a', '--all',
                        help = 'mark all conflicts as solved',
                        action = 'store_true'),
index 5763d09356408160c7bae23c2d44475c1d4b6697..20614b0fdd2af39b8503625e4d2b8617d046b7af 100644 (file)
@@ -40,7 +40,7 @@ under revision control. The files are prefixed as follows:
 A 'refresh' command clears the status of the modified, new and deleted
 files."""
 
-directory = DirectoryHasRepository()
+directory = DirectoryHasRepository(needs_current_series = False)
 options = [make_option('-m', '--modified',
                        help = 'show modified files only',
                        action = 'store_true'),