Commit Diff


commit - 93b39c2f4a792f8a83e7621425edbd48f0c16854
commit + ebd4d9a0266bb7a7145bcd6138bf64a5b0c1d004
blob - a36755abe9a86dda460f66de1cb5275ad1ac57b9
blob + adc1a793e253541b83360e9a96a100b0dfcebe65
--- got/got.1
+++ got/got.1
@@ -3460,7 +3460,7 @@ Alternatively, the merge may be aborted with
 .Tg sg
 .It Xo
 .Cm stage
-.Op Fl lpRS
+.Op Fl lpS
 .Op Fl F Ar response-script
 .Op Ar path ...
 .Xc
@@ -3540,13 +3540,6 @@ If a file is in modified status, individual patches de
 modified file content can be staged.
 Files in added or deleted status may only be staged or rejected in
 their entirety.
-.It Fl R
-Permit recursion into directories.
-If this option is not specified,
-.Cm got stage
-will refuse to run if a specified
-.Ar path
-is a directory.
 .It Fl S
 Allow staging of symbolic links which point outside of the path space
 that is under version control.
@@ -3589,7 +3582,7 @@ and may then be staged again if necessary.
 .Tg ug
 .It Xo
 .Cm unstage
-.Op Fl pR
+.Op Fl p
 .Op Fl F Ar response-script
 .Op Ar path ...
 .Xc
@@ -3638,13 +3631,6 @@ select or reject changes for unstaging based on
 If a file is staged in modified status, individual patches derived from the
 staged file content can be unstaged.
 Files staged in added or deleted status may only be unstaged in their entirety.
-.It Fl R
-Permit recursion into directories.
-If this option is not specified,
-.Cm got unstage
-will refuse to run if a specified
-.Ar path
-is a directory.
 .El
 .It Xo
 .Cm cat
blob - 9b22bd01524107cae5a5dc3a2b85913cadb5bd7b
blob + 855d9d97039be14a03f12d2f1a5712cfa8d7574b
--- got/got.c
+++ got/got.c
@@ -8025,42 +8025,6 @@ add_progress(void *arg, unsigned char status, const ch
 	while (path[0] == '/')
 		path++;
 	printf("%c  %s\n", status, path);
-	return NULL;
-}
-
-static const struct got_error *
-pathlist_contains_directory(int *contains_dir, struct got_worktree *worktree,
-    struct got_pathlist_head *paths)
-{
-	const struct got_error *error = NULL;
-	struct got_pathlist_entry *pe;
-	struct stat sb;
-	char *ondisk_path;
-
-	*contains_dir = 0;
-
-	TAILQ_FOREACH(pe, paths, entry) {
-		if (asprintf(&ondisk_path, "%s/%s",
-		    got_worktree_get_root_path(worktree),
-		    pe->path) == -1) {
-			return got_error_from_errno("asprintf");
-		}
-		if (lstat(ondisk_path, &sb) == -1) {
-			if (errno == ENOENT) {
-				free(ondisk_path);
-				continue;
-			}
-			error = got_error_from_errno2("lstat",
-			    ondisk_path);
-			free(ondisk_path);
-			return error;
-		}
-		free(ondisk_path);
-		if (S_ISDIR(sb.st_mode)) {
-			*contains_dir = 1;
-			return NULL;
-		}
-	}
 	return NULL;
 }
 
@@ -8072,7 +8036,8 @@ cmd_add(int argc, char *argv[])
 	struct got_worktree *worktree = NULL;
 	char *cwd = NULL;
 	struct got_pathlist_head paths;
-	int ch, contains_dir, can_recurse = 0, no_ignores = 0;
+	struct got_pathlist_entry *pe;
+	int ch, can_recurse = 0, no_ignores = 0;
 	int *pack_fds = NULL;
 
 	TAILQ_INIT(&paths);
@@ -8135,15 +8100,31 @@ cmd_add(int argc, char *argv[])
 		goto done;
 
 	if (!can_recurse) {
-		error = pathlist_contains_directory(&contains_dir, worktree,
-		    &paths);
-		if (error != NULL)
-			goto done;
-
-		if (contains_dir) {
-			error = got_error_msg(GOT_ERR_BAD_PATH,
-			    "adding directories requires -R option");
-			goto done;
+		char *ondisk_path;
+		struct stat sb;
+		TAILQ_FOREACH(pe, &paths, entry) {
+			if (asprintf(&ondisk_path, "%s/%s",
+			    got_worktree_get_root_path(worktree),
+			    pe->path) == -1) {
+				error = got_error_from_errno("asprintf");
+				goto done;
+			}
+			if (lstat(ondisk_path, &sb) == -1) {
+				if (errno == ENOENT) {
+					free(ondisk_path);
+					continue;
+				}
+				error = got_error_from_errno2("lstat",
+				    ondisk_path);
+				free(ondisk_path);
+				goto done;
+			}
+			free(ondisk_path);
+			if (S_ISDIR(sb.st_mode)) {
+				error = got_error_msg(GOT_ERR_BAD_PATH,
+				    "adding directories requires -R option");
+				goto done;
+			}
 		}
 	}
 
@@ -8199,8 +8180,9 @@ cmd_remove(int argc, char *argv[])
 	const char *status_codes = NULL;
 	char *cwd = NULL;
 	struct got_pathlist_head paths;
-	int contains_dir, ch, i, delete_local_mods = 0, can_recurse = 0;
-	int ignore_missing_paths = 0, keep_on_disk = 0;
+	struct got_pathlist_entry *pe;
+	int ch, delete_local_mods = 0, can_recurse = 0, keep_on_disk = 0, i;
+	int ignore_missing_paths = 0;
 	int *pack_fds = NULL;
 
 	TAILQ_INIT(&paths);
@@ -8283,15 +8265,31 @@ cmd_remove(int argc, char *argv[])
 		goto done;
 
 	if (!can_recurse) {
-		error = pathlist_contains_directory(&contains_dir, worktree,
-		    &paths);
-		if (error != NULL)
-			goto done;
-
-		if (contains_dir) {
-			error = got_error_msg(GOT_ERR_BAD_PATH,
-			    "removing directories requires -R option");
-			goto done;
+		char *ondisk_path;
+		struct stat sb;
+		TAILQ_FOREACH(pe, &paths, entry) {
+			if (asprintf(&ondisk_path, "%s/%s",
+			    got_worktree_get_root_path(worktree),
+			    pe->path) == -1) {
+				error = got_error_from_errno("asprintf");
+				goto done;
+			}
+			if (lstat(ondisk_path, &sb) == -1) {
+				if (errno == ENOENT) {
+					free(ondisk_path);
+					continue;
+				}
+				error = got_error_from_errno2("lstat",
+				    ondisk_path);
+				free(ondisk_path);
+				goto done;
+			}
+			free(ondisk_path);
+			if (S_ISDIR(sb.st_mode)) {
+				error = got_error_msg(GOT_ERR_BAD_PATH,
+				    "removing directories requires -R option");
+				goto done;
+			}
 		}
 	}
 
@@ -8915,7 +8913,8 @@ cmd_revert(int argc, char *argv[])
 	struct got_repository *repo = NULL;
 	char *cwd = NULL, *path = NULL;
 	struct got_pathlist_head paths;
-	int ch, contains_dir, can_recurse = 0, pflag = 0;
+	struct got_pathlist_entry *pe;
+	int ch, can_recurse = 0, pflag = 0;
 	FILE *patch_script_file = NULL;
 	const char *patch_script_path = NULL;
 	struct choose_patch_arg cpa;
@@ -8998,15 +8997,31 @@ cmd_revert(int argc, char *argv[])
 		goto done;
 
 	if (!can_recurse) {
-		error = pathlist_contains_directory(&contains_dir, worktree,
-		    &paths);
-		if (error != NULL)
-			goto done;
-
-		if (contains_dir) {
-			error = got_error_msg(GOT_ERR_BAD_PATH,
-			    "reverting directories requires -R option");
-			goto done;
+		char *ondisk_path;
+		struct stat sb;
+		TAILQ_FOREACH(pe, &paths, entry) {
+			if (asprintf(&ondisk_path, "%s/%s",
+			    got_worktree_get_root_path(worktree),
+			    pe->path) == -1) {
+				error = got_error_from_errno("asprintf");
+				goto done;
+			}
+			if (lstat(ondisk_path, &sb) == -1) {
+				if (errno == ENOENT) {
+					free(ondisk_path);
+					continue;
+				}
+				error = got_error_from_errno2("lstat",
+				    ondisk_path);
+				free(ondisk_path);
+				goto done;
+			}
+			free(ondisk_path);
+			if (S_ISDIR(sb.st_mode)) {
+				error = got_error_msg(GOT_ERR_BAD_PATH,
+				    "reverting directories requires -R option");
+				goto done;
+			}
 		}
 	}
 
@@ -13792,7 +13807,7 @@ done:
 __dead static void
 usage_stage(void)
 {
-	fprintf(stderr, "usage: %s stage [-lpRS] [-F response-script] "
+	fprintf(stderr, "usage: %s stage [-lpS] [-F response-script] "
 	    "[path ...]\n", getprogname());
 	exit(1);
 }
@@ -13832,8 +13847,7 @@ cmd_stage(int argc, char *argv[])
 	struct got_worktree *worktree = NULL;
 	char *cwd = NULL;
 	struct got_pathlist_head paths;
-	int ch, contains_dir;
-	int can_recurse = 0, list_stage = 0, pflag = 0, allow_bad_symlinks = 0;
+	int ch, list_stage = 0, pflag = 0, allow_bad_symlinks = 0;
 	FILE *patch_script_file = NULL;
 	const char *patch_script_path = NULL;
 	struct choose_patch_arg cpa;
@@ -13847,7 +13861,7 @@ cmd_stage(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
-	while ((ch = getopt(argc, argv, "F:lpRS")) != -1) {
+	while ((ch = getopt(argc, argv, "F:lpS")) != -1) {
 		switch (ch) {
 		case 'F':
 			patch_script_path = optarg;
@@ -13858,9 +13872,6 @@ cmd_stage(int argc, char *argv[])
 		case 'p':
 			pflag = 1;
 			break;
-		case 'R':
-			can_recurse = 1;
-			break;
 		case 'S':
 			allow_bad_symlinks = 1;
 			break;
@@ -13925,18 +13936,6 @@ cmd_stage(int argc, char *argv[])
 		error = got_worktree_status(worktree, &paths, repo, 0,
 		    print_stage, NULL, check_cancelled, NULL);
 	else {
-		if (!can_recurse) {
-			error = pathlist_contains_directory(&contains_dir,
-			    worktree, &paths);
-			if (error != NULL)
-				goto done;
-
-			if (contains_dir) {
-				error = got_error_msg(GOT_ERR_BAD_PATH,
-				    "staging directories requires -R option");
-				goto done;
-			}
-		}
 		cpa.patch_script_file = patch_script_file;
 		cpa.action = "stage";
 		error = got_worktree_stage(worktree, &paths,
@@ -13969,7 +13968,7 @@ done:
 __dead static void
 usage_unstage(void)
 {
-	fprintf(stderr, "usage: %s unstage [-pR] [-F response-script] "
+	fprintf(stderr, "usage: %s unstage [-p] [-F response-script] "
 	    "[path ...]\n", getprogname());
 	exit(1);
 }
@@ -13983,7 +13982,7 @@ cmd_unstage(int argc, char *argv[])
 	struct got_worktree *worktree = NULL;
 	char *cwd = NULL;
 	struct got_pathlist_head paths;
-	int ch, contains_dir, can_recurse = 0, pflag = 0;
+	int ch, pflag = 0;
 	struct got_update_progress_arg upa;
 	FILE *patch_script_file = NULL;
 	const char *patch_script_path = NULL;
@@ -13998,14 +13997,11 @@ cmd_unstage(int argc, char *argv[])
 		err(1, "pledge");
 #endif
 
-	while ((ch = getopt(argc, argv, "F:Rp")) != -1) {
+	while ((ch = getopt(argc, argv, "F:p")) != -1) {
 		switch (ch) {
 		case 'F':
 			patch_script_path = optarg;
 			break;
-		case 'R':
-			can_recurse = 1;
-			break;
 		case 'p':
 			pflag = 1;
 			break;
@@ -14061,19 +14057,6 @@ cmd_unstage(int argc, char *argv[])
 	if (error)
 		goto done;
 
-	if (!can_recurse) {
-		error = pathlist_contains_directory(&contains_dir,
-		    worktree, &paths);
-		if (error != NULL)
-			goto done;
-
-		if (contains_dir) {
-			error = got_error_msg(GOT_ERR_BAD_PATH,
-			    "unstaging directories requires -R option");
-			goto done;
-		}
-	}
-
 	cpa.patch_script_file = patch_script_file;
 	cpa.action = "unstage";
 	memset(&upa, 0, sizeof(upa));
blob - 56c7c3d94ec8c638360c2980c7e28c7de32199e4
blob + 3c2cfbb76859df180a86e0ad56d976c5f0327eb8
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
@@ -37,42 +37,8 @@ test_stage_basic() {
 	echo ' M alpha' > $testroot/stdout.expected
 	echo ' D beta' >> $testroot/stdout.expected
 	echo ' A foo' >> $testroot/stdout.expected
-	(cd $testroot/wt && got stage -R > $testroot/stdout)
-
-	cmp -s $testroot/stdout.expected $testroot/stdout
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		diff -u $testroot/stdout.expected $testroot/stdout
-	fi
-	test_done "$testroot" "$ret"
-}
-
-test_stage_directory() {
-	local testroot=`test_init stage_directory`
-
-	got checkout $testroot/repo $testroot/wt > /dev/null
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		test_done "$testroot" "$ret"
-		return 1
-	fi
-
-	(cd $testroot/wt && echo -n > test && got add test > /dev/null)
-	(cd $testroot/wt && got stage . > $testroot/stdout 2> $testroot/stderr)
-	ret=$?
-	echo "got: staging directories requires -R option" \
-		> $testroot/stderr.expected
-	cmp -s $testroot/stderr.expected $testroot/stderr
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		diff -u $testroot/stderr.expected $testroot/stderr
-		test_done "$testroot" "$ret"
-		return 1
-	fi
+	(cd $testroot/wt && got stage > $testroot/stdout)
 
-	(cd $testroot/wt && got stage -R . > $testroot/stdout)
-
-	echo ' A test' >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -143,7 +109,7 @@ test_stage_unversioned() {
 		return 1
 	fi
 
-	(cd $testroot/wt && got stage -R > $testroot/stdout)
+	(cd $testroot/wt && got stage > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got stage command failed unexpectedly" >&2
@@ -223,7 +189,7 @@ test_stage_list() {
 	echo ' A foo' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage alpha beta foo > /dev/null)
 
-	(cd $testroot/wt && got stage -Rl > $testroot/stdout)
+	(cd $testroot/wt && got stage -l > $testroot/stdout)
 	(cd $testroot/wt && got diff -s alpha | grep '^blob +' | \
 		cut -d' ' -f3 | tr -d '\n' > $testroot/stdout.expected)
 	echo " M alpha" >> $testroot/stdout.expected
@@ -1310,7 +1276,7 @@ test_stage_commit_out_of_date() {
 		return 1
 	fi
 
-	(cd $testroot/wt && got unstage -R > /dev/null)
+	(cd $testroot/wt && got unstage > /dev/null)
 	(cd $testroot/wt && got update > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1334,7 +1300,7 @@ test_stage_commit_out_of_date() {
 	# resolve conflict
 	echo "resolved file" > $testroot/wt/alpha
 
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	(cd $testroot/wt && got commit -m "try again" > $testroot/stdout)
 	ret=$?
@@ -1657,7 +1623,7 @@ EOF
 		return 1
 	fi
 
-	(cd $testroot/wt && got unstage -R >/dev/null)
+	(cd $testroot/wt && got unstage >/dev/null)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got stage command failed unexpectedly" >&2
@@ -2286,7 +2252,7 @@ test_stage_patch_quit() {
 	# stage first hunk and quit; and don't pass a path argument to
 	# ensure that we don't skip asking about the 'zzz' file after 'quit'
 	printf "y\nq\nn\n" > $testroot/patchscript
-	(cd $testroot/wt && got stage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		> $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -2396,7 +2362,7 @@ test_stage_patch_incomplete_script() {
 
 	# stage first hunk and then stop responding; got should error out
 	printf "y\n" > $testroot/patchscript
-	(cd $testroot/wt && got stage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		> $testroot/stdout 2> $testroot/stderr)
 	ret=$?
 	if [ $ret -eq 0 ]; then
@@ -2498,7 +2464,7 @@ test_stage_symlink() {
 	(cd $testroot/wt && ln -sf gamma/delta zeta.link)
 	(cd $testroot/wt && got add zeta.link > /dev/null)
 
-	(cd $testroot/wt && got stage -R > $testroot/stdout 2> $testroot/stderr)
+	(cd $testroot/wt && got stage > $testroot/stdout 2> $testroot/stderr)
 	ret=$?
 	if [ $ret -eq 0 ]; then
 		echo "got stage succeeded unexpectedly" >&2
@@ -2516,7 +2482,7 @@ test_stage_symlink() {
 		return 1
 	fi
 
-	(cd $testroot/wt && got stage -RS > $testroot/stdout)
+	(cd $testroot/wt && got stage -S > $testroot/stdout)
 
 	cat > $testroot/stdout.expected <<EOF
  M alpha.link
@@ -2812,7 +2778,7 @@ test_stage_patch_symlink() {
 	(cd $testroot/wt && got add zeta.link > /dev/null)
 
 	printf "y\nn\ny\nn\ny\ny\ny" > $testroot/patchscript
-	(cd $testroot/wt && got stage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got stage -F $testroot/patchscript -p \
 		> $testroot/stdout)
 
 	cat > $testroot/stdout.expected <<EOF
@@ -3077,7 +3043,6 @@ EOF
 
 test_parseargs "$@"
 run_test test_stage_basic
-run_test test_stage_directory
 run_test test_stage_no_changes
 run_test test_stage_unversioned
 run_test test_stage_nonexistent
blob - 2fca3b7bc8c926ed84027fe7ac16c1c8bc9f1e45
blob + 5f9b7bb3b3a19f838ac5afc1984ab0cc09919ed9
--- regress/cmdline/unstage.sh
+++ regress/cmdline/unstage.sh
@@ -36,7 +36,7 @@ test_unstage_basic() {
 	echo ' A foo' >> $testroot/stdout.expected
 	(cd $testroot/wt && got stage alpha beta foo > /dev/null)
 
-	(cd $testroot/wt && got unstage -R > $testroot/stdout)
+	(cd $testroot/wt && got unstage > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got unstage command failed unexpectedly" >&2
@@ -67,43 +67,6 @@ test_unstage_basic() {
 	test_done "$testroot" "$ret"
 }
 
-test_unstage_directory() {
-	local testroot=`test_init unstage_directory`
-
-	got checkout $testroot/repo $testroot/wt > /dev/null
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		test_done "$testroot" "$ret"
-		return 1
-	fi
-
-	(cd $testroot/wt && echo -n > test && got add test > /dev/null \
-		&& got stage test > /dev/null)
-
-	(cd $testroot/wt && got unstage . > $testroot/stdout 2> $testroot/stderr)
-	ret=$?
-	echo "got: unstaging directories requires -R option" \
-		> $testroot/stderr.expected
-	cmp -s $testroot/stderr.expected $testroot/stderr
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		diff -u $testroot/stderr.expected $testroot/stderr
-		test_done "$testroot" "$ret"
-		return 1
-	fi
-
-	(cd $testroot/wt && got unstage -R . > $testroot/stdout)
-
-	echo 'G  test' >> $testroot/stdout.expected
-
-	cmp -s $testroot/stdout.expected $testroot/stdout
-	ret=$?
-	if [ $ret -ne 0 ]; then
-		diff -u $testroot/stdout.expected $testroot/stdout
-	fi
-	test_done "$testroot" "$ret"
-}
-
 test_unstage_unversioned() {
 	local testroot=`test_init unstage_unversioned`
 
@@ -122,7 +85,7 @@ test_unstage_unversioned() {
 	echo ' M alpha' > $testroot/stdout.expected
 	echo ' D beta' >> $testroot/stdout.expected
 	echo ' A foo' >> $testroot/stdout.expected
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	touch $testroot/wt/unversioned-file
 
@@ -139,7 +102,7 @@ test_unstage_unversioned() {
 		return 1
 	fi
 
-	(cd $testroot/wt && got unstage -R > $testroot/stdout)
+	(cd $testroot/wt && got unstage > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got unstage command failed unexpectedly" >&2
@@ -158,7 +121,7 @@ test_unstage_unversioned() {
 		return 1
 	fi
 
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	# unstaging an unversioned path is a no-op
 	(cd $testroot/wt && got unstage unversioned > $testroot/stdout)
@@ -200,7 +163,7 @@ test_unstage_nonexistent() {
 	echo ' M alpha' > $testroot/stdout.expected
 	echo ' D beta' >> $testroot/stdout.expected
 	echo ' A foo' >> $testroot/stdout.expected
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	# unstaging a non-existent file is a no-op
 	(cd $testroot/wt && got unstage nonexistent-file > $testroot/stdout)
@@ -242,7 +205,7 @@ test_unstage_patch() {
 	w
 	EOF
 
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got stage command failed unexpectedly" >&2
@@ -252,7 +215,7 @@ test_unstage_patch() {
 
 	# don't unstage any hunks
 	printf "n\nn\nn\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		numbers > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -316,7 +279,7 @@ EOF
 
 	# unstage middle hunk
 	printf "n\ny\nn\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		numbers > $testroot/stdout)
 
 	cat > $testroot/stdout.expected <<EOF
@@ -441,7 +404,7 @@ EOF
 		return 1
 	fi
 
-	(cd $testroot/wt && got stage -R >/dev/null)
+	(cd $testroot/wt && got stage >/dev/null)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got stage command failed unexpectedly" >&2
@@ -461,7 +424,7 @@ EOF
 
 	# unstage last hunk
 	printf "n\nn\ny\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		numbers > $testroot/stdout)
 
 	cat > $testroot/stdout.expected <<EOF
@@ -583,7 +546,7 @@ EOF
 		return 1
 	fi
 
-	(cd $testroot/wt && got stage -R >/dev/null)
+	(cd $testroot/wt && got stage >/dev/null)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got stage command failed unexpectedly" >&2
@@ -603,7 +566,7 @@ EOF
 
 	# unstage all hunks
 	printf "y\ny\ny\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		numbers > $testroot/stdout)
 
 	cat > $testroot/stdout.expected <<EOF
@@ -727,10 +690,10 @@ test_unstage_patch_added() {
 	echo "new" > $testroot/wt/epsilon/new
 	(cd $testroot/wt && got add epsilon/new > /dev/null)
 
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	printf "y\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		epsilon/new > $testroot/stdout)
 
 	echo "A  epsilon/new" > $testroot/stdout.expected
@@ -795,10 +758,10 @@ test_unstage_patch_removed() {
 	fi
 
 	(cd $testroot/wt && got rm beta > /dev/null)
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	printf "y\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		beta > $testroot/stdout)
 
 	echo "D  beta" > $testroot/stdout.expected
@@ -876,12 +839,12 @@ test_unstage_patch_quit() {
 	w
 	EOF
 	(cd $testroot/wt && got rm zzz > /dev/null)
-	(cd $testroot/wt && got stage -R > /dev/null)
+	(cd $testroot/wt && got stage > /dev/null)
 
 	# unstage first hunk and quit; and don't pass a path argument to
 	# ensure that we don't skip asking about the 'zzz' file after 'quit'
 	printf "y\nq\nn\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		> $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1040,7 +1003,7 @@ test_unstage_symlink() {
 	(cd $testroot/wt && ln -sf gamma/delta zeta.link)
 	(cd $testroot/wt && got add zeta.link > /dev/null)
 
-	(cd $testroot/wt && got stage -RS > /dev/null)
+	(cd $testroot/wt && got stage -S > /dev/null)
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 	cat > $testroot/stdout.expected <<EOF
@@ -1060,7 +1023,7 @@ EOF
 		return 1
 	fi
 
-	(cd $testroot/wt && got unstage -R > $testroot/stdout)
+	(cd $testroot/wt && got unstage > $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
 		echo "got unstage command failed unexpectedly" >&2
@@ -1235,7 +1198,7 @@ test_unstage_patch_symlink() {
 	(cd $testroot/wt && ln -sf beta zeta3.link)
 	(cd $testroot/wt && got add zeta3.link > /dev/null)
 
-	(cd $testroot/wt && got stage -RS > /dev/null)
+	(cd $testroot/wt && got stage -S > /dev/null)
 
 	(cd $testroot/wt && got status > $testroot/stdout)
 	cat > $testroot/stdout.expected <<EOF
@@ -1259,7 +1222,7 @@ EOF
 	fi
 
 	printf "y\nn\ny\nn\ny\ny\nn\ny\ny\n" > $testroot/patchscript
-	(cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \
+	(cd $testroot/wt && got unstage -F $testroot/patchscript -p \
 		> $testroot/stdout)
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1477,7 +1440,6 @@ EOF
 
 test_parseargs "$@"
 run_test test_unstage_basic
-run_test test_unstage_directory
 run_test test_unstage_unversioned
 run_test test_unstage_nonexistent
 run_test test_unstage_patch