commit a6dfa7b2fc6f025f11ff57a315c99d96014550d8 from: "Lorenz (xha)" via: Thomas Adam date: Thu Apr 25 14:57:52 2024 UTC require -R option for staging or unstaging directory contents -R is needed on almost all other commands so this makes things consistent. Patch by Lorenz (xha) commit - 06dc3607479d190ff1dacaad2823903c41ff024f commit + a6dfa7b2fc6f025f11ff57a315c99d96014550d8 blob - 4b47dee9aa9889b4af2b5f244668c1b65df4e331 blob + 59890cb8a1a778ec76fcdca844df0b233f20c342 --- 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 lpS +.Op Fl lpRS .Op Fl F Ar response-script .Op Ar path ... .Xc @@ -3540,6 +3540,13 @@ 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. @@ -3582,7 +3589,7 @@ and may then be staged again if necessary. .Tg ug .It Xo .Cm unstage -.Op Fl p +.Op Fl pR .Op Fl F Ar response-script .Op Ar path ... .Xc @@ -3631,6 +3638,13 @@ 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 - 92a8f05c92c261ded6044f2c5d6917dfdfe2a38e blob + 31c07cd69ecc36c386c0a308d3eb11e9739a64b5 --- got/got.c +++ got/got.c @@ -8029,6 +8029,42 @@ add_progress(void *arg, unsigned char status, const ch } static const struct got_error * +check_paths_contains_dir(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; +} + +static const struct got_error * cmd_add(int argc, char *argv[]) { const struct got_error *error = NULL; @@ -8036,8 +8072,7 @@ cmd_add(int argc, char *argv[]) struct got_worktree *worktree = NULL; char *cwd = NULL; struct got_pathlist_head paths; - struct got_pathlist_entry *pe; - int ch, can_recurse = 0, no_ignores = 0; + int ch, contains_dir, can_recurse = 0, no_ignores = 0; int *pack_fds = NULL; TAILQ_INIT(&paths); @@ -8100,31 +8135,14 @@ cmd_add(int argc, char *argv[]) goto done; if (!can_recurse) { - 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; - } + error = check_paths_contains_dir(&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; } } @@ -8180,9 +8198,8 @@ cmd_remove(int argc, char *argv[]) const char *status_codes = NULL; char *cwd = NULL; struct got_pathlist_head paths; - 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 contains_dir, ch, i, delete_local_mods = 0, can_recurse = 0; + int ignore_missing_paths = 0, keep_on_disk = 0; int *pack_fds = NULL; TAILQ_INIT(&paths); @@ -8265,31 +8282,14 @@ cmd_remove(int argc, char *argv[]) goto done; if (!can_recurse) { - 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; - } + error = check_paths_contains_dir(&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; } } @@ -8913,8 +8913,7 @@ cmd_revert(int argc, char *argv[]) struct got_repository *repo = NULL; char *cwd = NULL, *path = NULL; struct got_pathlist_head paths; - struct got_pathlist_entry *pe; - int ch, can_recurse = 0, pflag = 0; + int ch, contains_dir, can_recurse = 0, pflag = 0; FILE *patch_script_file = NULL; const char *patch_script_path = NULL; struct choose_patch_arg cpa; @@ -8997,31 +8996,14 @@ cmd_revert(int argc, char *argv[]) goto done; if (!can_recurse) { - 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; - } + error = check_paths_contains_dir(&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; } } @@ -13807,7 +13789,7 @@ done: __dead static void usage_stage(void) { - fprintf(stderr, "usage: %s stage [-lpS] [-F response-script] " + fprintf(stderr, "usage: %s stage [-lpRS] [-F response-script] " "[path ...]\n", getprogname()); exit(1); } @@ -13847,7 +13829,8 @@ cmd_stage(int argc, char *argv[]) struct got_worktree *worktree = NULL; char *cwd = NULL; struct got_pathlist_head paths; - int ch, list_stage = 0, pflag = 0, allow_bad_symlinks = 0; + int ch, contains_dir; + int can_recurse = 0, 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; @@ -13861,7 +13844,7 @@ cmd_stage(int argc, char *argv[]) err(1, "pledge"); #endif - while ((ch = getopt(argc, argv, "F:lpS")) != -1) { + while ((ch = getopt(argc, argv, "F:lpRS")) != -1) { switch (ch) { case 'F': patch_script_path = optarg; @@ -13872,6 +13855,9 @@ cmd_stage(int argc, char *argv[]) case 'p': pflag = 1; break; + case 'R': + can_recurse = 1; + break; case 'S': allow_bad_symlinks = 1; break; @@ -13936,6 +13922,18 @@ 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 = check_paths_contains_dir(&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, @@ -13968,7 +13966,7 @@ done: __dead static void usage_unstage(void) { - fprintf(stderr, "usage: %s unstage [-p] [-F response-script] " + fprintf(stderr, "usage: %s unstage [-pR] [-F response-script] " "[path ...]\n", getprogname()); exit(1); } @@ -13982,7 +13980,7 @@ cmd_unstage(int argc, char *argv[]) struct got_worktree *worktree = NULL; char *cwd = NULL; struct got_pathlist_head paths; - int ch, pflag = 0; + int ch, contains_dir, can_recurse = 0, pflag = 0; struct got_update_progress_arg upa; FILE *patch_script_file = NULL; const char *patch_script_path = NULL; @@ -13997,11 +13995,14 @@ cmd_unstage(int argc, char *argv[]) err(1, "pledge"); #endif - while ((ch = getopt(argc, argv, "F:p")) != -1) { + while ((ch = getopt(argc, argv, "F:Rp")) != -1) { switch (ch) { case 'F': patch_script_path = optarg; break; + case 'R': + can_recurse = 1; + break; case 'p': pflag = 1; break; @@ -14056,6 +14057,19 @@ cmd_unstage(int argc, char *argv[]) error = get_worktree_paths_from_argv(&paths, argc, argv, worktree); if (error) goto done; + + if (!can_recurse) { + error = check_paths_contains_dir(&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"; blob - 3c2cfbb76859df180a86e0ad56d976c5f0327eb8 blob + 3574d07a0fe6f57793fe8dbfe5997c032aa0b710 --- regress/cmdline/stage.sh +++ regress/cmdline/stage.sh @@ -37,7 +37,7 @@ 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 > $testroot/stdout) + (cd $testroot/wt && got stage -R > $testroot/stdout) cmp -s $testroot/stdout.expected $testroot/stdout ret=$? @@ -47,6 +47,41 @@ test_stage_basic() { 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 -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 + test_done "$testroot" "$ret" + return 1 + fi +} + test_stage_no_changes() { local testroot=`test_init stage_no_changes` @@ -109,7 +144,7 @@ test_stage_unversioned() { return 1 fi - (cd $testroot/wt && got stage > $testroot/stdout) + (cd $testroot/wt && got stage -R > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then echo "got stage command failed unexpectedly" >&2 @@ -189,7 +224,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 -l > $testroot/stdout) + (cd $testroot/wt && got stage -Rl > $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 @@ -1276,7 +1311,7 @@ test_stage_commit_out_of_date() { return 1 fi - (cd $testroot/wt && got unstage > /dev/null) + (cd $testroot/wt && got unstage -R > /dev/null) (cd $testroot/wt && got update > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then @@ -1300,7 +1335,7 @@ test_stage_commit_out_of_date() { # resolve conflict echo "resolved file" > $testroot/wt/alpha - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) (cd $testroot/wt && got commit -m "try again" > $testroot/stdout) ret=$? @@ -1623,7 +1658,7 @@ EOF return 1 fi - (cd $testroot/wt && got unstage >/dev/null) + (cd $testroot/wt && got unstage -R >/dev/null) ret=$? if [ $ret -ne 0 ]; then echo "got stage command failed unexpectedly" >&2 @@ -2252,7 +2287,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 -F $testroot/patchscript -p \ + (cd $testroot/wt && got stage -R -F $testroot/patchscript -p \ > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then @@ -2362,7 +2397,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 -F $testroot/patchscript -p \ + (cd $testroot/wt && got stage -R -F $testroot/patchscript -p \ > $testroot/stdout 2> $testroot/stderr) ret=$? if [ $ret -eq 0 ]; then @@ -2464,7 +2499,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 > $testroot/stdout 2> $testroot/stderr) + (cd $testroot/wt && got stage -R > $testroot/stdout 2> $testroot/stderr) ret=$? if [ $ret -eq 0 ]; then echo "got stage succeeded unexpectedly" >&2 @@ -2482,7 +2517,7 @@ test_stage_symlink() { return 1 fi - (cd $testroot/wt && got stage -S > $testroot/stdout) + (cd $testroot/wt && got stage -RS > $testroot/stdout) cat > $testroot/stdout.expected < /dev/null) printf "y\nn\ny\nn\ny\ny\ny" > $testroot/patchscript - (cd $testroot/wt && got stage -F $testroot/patchscript -p \ + (cd $testroot/wt && got stage -R -F $testroot/patchscript -p \ > $testroot/stdout) cat > $testroot/stdout.expected <> $testroot/stdout.expected (cd $testroot/wt && got stage alpha beta foo > /dev/null) - (cd $testroot/wt && got unstage > $testroot/stdout) + (cd $testroot/wt && got unstage -R > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then echo "got unstage command failed unexpectedly" >&2 @@ -67,6 +67,44 @@ 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 + test_done "$testroot" "$ret" + return 1 + fi +} + test_unstage_unversioned() { local testroot=`test_init unstage_unversioned` @@ -85,7 +123,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 > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) touch $testroot/wt/unversioned-file @@ -102,7 +140,7 @@ test_unstage_unversioned() { return 1 fi - (cd $testroot/wt && got unstage > $testroot/stdout) + (cd $testroot/wt && got unstage -R > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then echo "got unstage command failed unexpectedly" >&2 @@ -121,7 +159,7 @@ test_unstage_unversioned() { return 1 fi - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) # unstaging an unversioned path is a no-op (cd $testroot/wt && got unstage unversioned > $testroot/stdout) @@ -163,7 +201,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 > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) # unstaging a non-existent file is a no-op (cd $testroot/wt && got unstage nonexistent-file > $testroot/stdout) @@ -205,7 +243,7 @@ test_unstage_patch() { w EOF - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) ret=$? if [ $ret -ne 0 ]; then echo "got stage command failed unexpectedly" >&2 @@ -215,7 +253,7 @@ test_unstage_patch() { # don't unstage any hunks printf "n\nn\nn\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ numbers > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then @@ -279,7 +317,7 @@ EOF # unstage middle hunk printf "n\ny\nn\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ numbers > $testroot/stdout) cat > $testroot/stdout.expected </dev/null) + (cd $testroot/wt && got stage -R >/dev/null) ret=$? if [ $ret -ne 0 ]; then echo "got stage command failed unexpectedly" >&2 @@ -424,7 +462,7 @@ EOF # unstage last hunk printf "n\nn\ny\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ numbers > $testroot/stdout) cat > $testroot/stdout.expected </dev/null) + (cd $testroot/wt && got stage -R >/dev/null) ret=$? if [ $ret -ne 0 ]; then echo "got stage command failed unexpectedly" >&2 @@ -566,7 +604,7 @@ EOF # unstage all hunks printf "y\ny\ny\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ numbers > $testroot/stdout) cat > $testroot/stdout.expected < $testroot/wt/epsilon/new (cd $testroot/wt && got add epsilon/new > /dev/null) - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) printf "y\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ epsilon/new > $testroot/stdout) echo "A epsilon/new" > $testroot/stdout.expected @@ -758,10 +796,10 @@ test_unstage_patch_removed() { fi (cd $testroot/wt && got rm beta > /dev/null) - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /dev/null) printf "y\n" > $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ beta > $testroot/stdout) echo "D beta" > $testroot/stdout.expected @@ -839,12 +877,12 @@ test_unstage_patch_quit() { w EOF (cd $testroot/wt && got rm zzz > /dev/null) - (cd $testroot/wt && got stage > /dev/null) + (cd $testroot/wt && got stage -R > /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 -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then @@ -1003,7 +1041,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 -S > /dev/null) + (cd $testroot/wt && got stage -RS > /dev/null) (cd $testroot/wt && got status > $testroot/stdout) cat > $testroot/stdout.expected < $testroot/stdout) + (cd $testroot/wt && got unstage -R > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then echo "got unstage command failed unexpectedly" >&2 @@ -1198,7 +1236,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 -S > /dev/null) + (cd $testroot/wt && got stage -RS > /dev/null) (cd $testroot/wt && got status > $testroot/stdout) cat > $testroot/stdout.expected < $testroot/patchscript - (cd $testroot/wt && got unstage -F $testroot/patchscript -p \ + (cd $testroot/wt && got unstage -R -F $testroot/patchscript -p \ > $testroot/stdout) ret=$? if [ $ret -ne 0 ]; then @@ -1440,6 +1478,7 @@ 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