allow the 'got fetch' -l option together with the -q option Make use of this in tests to hide useless output from ssh(1).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/got/got.1 b/got/got.1
index 84e6393..8560ea5 100644
--- a/got/got.1
+++ b/got/got.1
@@ -391,7 +391,8 @@ Git's garbage collector.
List branches and tags available for fetching from the remote repository
and exit immediately.
Cannot be used together with any of the other options except
-.Fl v
+.Fl v ,
+.Fl q ,
and
.Fl r .
.It Fl t
diff --git a/got/got.c b/got/got.c
index 1a0fbb7..dc1e82d 100644
--- a/got/got.c
+++ b/got/got.c
@@ -2087,8 +2087,6 @@ cmd_fetch(int argc, char *argv[])
option_conflict('l', 'a');
if (delete_refs)
option_conflict('l', 'd');
- if (verbosity == -1)
- option_conflict('l', 'q');
}
if (argc == 0)
diff --git a/regress/cmdline/fetch.sh b/regress/cmdline/fetch.sh
index 1fc5c95..06f040f 100755
--- a/regress/cmdline/fetch.sh
+++ b/regress/cmdline/fetch.sh
@@ -136,7 +136,7 @@ test_fetch_list() {
return 1
fi
- (cd $testroot/repo-clone && got fetch -l \
+ (cd $testroot/repo-clone && got fetch -q -l \
> $testroot/stdout 2>$testroot/stderr)
ret="$?"
if [ "$ret" != "0" ]; then
@@ -145,8 +145,7 @@ test_fetch_list() {
return 1
fi
- echo "Connecting to \"origin\" 127.0.0.1" > $testroot/stdout.expected
- got ref -l -r $testroot/repo >> $testroot/stdout.expected
+ got ref -l -r $testroot/repo > $testroot/stdout.expected
cmp -s $testroot/stdout $testroot/stdout.expected
ret="$?"
@@ -999,7 +998,7 @@ remote "barbaz" {
EOF
echo "got: nonexistent: remote repository not found" \
> $testroot/stderr.expected
- (cd $testroot/repo-clone && got fetch nonexistent \
+ (cd $testroot/repo-clone && got fetch -q nonexistent \
> $testroot/stdout 2> $testroot/stderr)
ret="$?"
if [ "$ret" = "0" ]; then
@@ -1009,7 +1008,7 @@ EOF
return 1
fi
- (cd $testroot/repo-clone && got fetch -l foobar \
+ (cd $testroot/repo-clone && got fetch -q -l foobar \
> $testroot/stdout)
ret="$?"
if [ "$ret" != "0" ]; then
@@ -1018,8 +1017,7 @@ EOF
return 1
fi
- echo "Connecting to \"foobar\" 127.0.0.1" > $testroot/stdout.expected
- got ref -l -r $testroot/repo >> $testroot/stdout.expected
+ got ref -l -r $testroot/repo > $testroot/stdout.expected
cmp -s $testroot/stdout $testroot/stdout.expected
ret="$?"
@@ -1038,7 +1036,7 @@ remote "barbaz" {
repository "$testroot/repo"
}
EOF
- (cd $testroot/wt && got fetch -l barbaz > $testroot/stdout)
+ (cd $testroot/wt && got fetch -q -l barbaz > $testroot/stdout)
ret="$?"
if [ "$ret" != "0" ]; then
echo "got fetch command failed unexpectedly" >&2
@@ -1046,8 +1044,7 @@ EOF
return 1
fi
- echo "Connecting to \"barbaz\" 127.0.0.1" > $testroot/stdout.expected
- got ref -l -r $testroot/repo >> $testroot/stdout.expected
+ got ref -l -r $testroot/repo > $testroot/stdout.expected
cmp -s $testroot/stdout $testroot/stdout.expected
ret="$?"