l10n: sv.po: Update Swedish translation (3288t0f0u)
[gitweb.git] / t / test-lib-functions.sh
index 5ee124332a713b1dec984090401b08efb2b9cfe9..1701fe2a06057530d845b91b4fd4cce99b4521a2 100644 (file)
@@ -42,6 +42,7 @@ test_decode_color () {
                function name(n) {
                        if (n == 0) return "RESET";
                        if (n == 1) return "BOLD";
+                       if (n == 7) return "REVERSE";
                        if (n == 30) return "BLACK";
                        if (n == 31) return "RED";
                        if (n == 32) return "GREEN";
@@ -216,6 +217,11 @@ test_chmod () {
        git update-index --add "--chmod=$@"
 }
 
+# Get the modebits from a file.
+test_modebits () {
+       ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
+}
+
 # Unset a configuration variable, but don't fail if it doesn't exist.
 test_unconfig () {
        config_dir=
@@ -994,6 +1000,7 @@ test_copy_bytes () {
                        my $s;
                        my $nread = sysread(STDIN, $s, $len);
                        die "cannot read: $!" unless defined($nread);
+                       last unless $nread;
                        print $s;
                        $len -= $nread;
                }