commit 612392ee9a232ecb6f4f9db91eafbe6693509bd9 from: Stefan Sperling date: Tue Jan 05 14:01:16 2021 UTC allow the 'got fetch' -l option together with the -q option Make use of this in tests to hide useless output from ssh(1). commit - 15d3c221e34cad474e87c43111417186822c887c commit + 612392ee9a232ecb6f4f9db91eafbe6693509bd9 blob - 84e6393a0ccccffa54f45e6a0864788439cbf871 blob + 8560ea5c09c6270970313026296fcfd2db1938be --- got/got.1 +++ 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 blob - 1a0fbb720f4427b7c07a93e638a484560ec1d37b blob + dc1e82d384f2df7cfb6e25b766911671ad36b60b --- got/got.c +++ 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) blob - 1fc5c95a555dfce8b88c9df9c019ea1ae8d57848 blob + 06f040fb232eedbd33669ed3c736c29d8747c09f --- regress/cmdline/fetch.sh +++ 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="$?"