Commit fb9704afe0e40de783660e26d5498278a47affca

Stefan Sperling 2020-01-27T17:07:01

do not display unversioned files during 'got revert -R'

diff --git a/got/got.c b/got/got.c
index 6b7a4b5..b44f1a8 100644
--- a/got/got.c
+++ b/got/got.c
@@ -4345,6 +4345,9 @@ usage_revert(void)
 static const struct got_error *
 revert_progress(void *arg, unsigned char status, const char *path)
 {
+	if (status == GOT_STATUS_UNVERSIONED)
+		return NULL;
+
 	while (path[0] == '/')
 		path++;
 	printf("%c  %s\n", status, path);
diff --git a/regress/cmdline/revert.sh b/regress/cmdline/revert.sh
index 6e6d96b..82051ed 100755
--- a/regress/cmdline/revert.sh
+++ b/regress/cmdline/revert.sh
@@ -337,7 +337,6 @@ function test_revert_directory_unknown {
 	(cd $testroot/wt && got revert -R . > $testroot/stdout)
 
 	echo 'R  alpha' > $testroot/stdout.expected
-	echo '?  epsilon/new_file' >> $testroot/stdout.expected
 	echo 'R  epsilon/zeta' >> $testroot/stdout.expected
 	cmp -s $testroot/stdout.expected $testroot/stdout
 	ret="$?"