summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKacper Kornet <draenog@pld-linux.org>2013-10-31 12:51:32 +0100
committerJunio C Hamano <gitster@pobox.com>2013-10-31 10:24:33 -0700
commitfbc812a6009ebc91f4870c3572821cb4d68184f8 (patch)
tree8b43ba39fbb2b24a730fcc5ace38699b039b6ad8
parent16c159d75af29b1929af0e2f341d26fce4e1d546 (diff)
downloadgit-jk/duplicate-objects-in-packs.tar.gz
Fix '\%o' for printf from coreutilsjk/duplicate-objects-in-packs
The printf utility provided by coreutils when interpreting '\%o' format does not recognize %o as formatting directive. For example printf '\%o 0 returns \%o and warning: ignoring excess arguments, starting with ‘0’, which results in failed tests in t5309-pack-delta-cycles.sh. In most shells the test ends with success as the printf is a builtin utility. Fix it by using '\\%o' which is interpreted consistently in all versions of printf. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/lib-pack.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/lib-pack.sh b/t/lib-pack.sh
index 7e8685b44c..b96e1254dd 100644
--- a/t/lib-pack.sh
+++ b/t/lib-pack.sh
@@ -12,10 +12,10 @@
# Print the big-endian 4-byte octal representation of $1
uint32_octal () {
n=$1
- printf '\%o' $(($n / 16777216)); n=$((n % 16777216))
- printf '\%o' $(($n / 65536)); n=$((n % 65536))
- printf '\%o' $(($n / 256)); n=$((n % 256))
- printf '\%o' $(($n ));
+ printf '\\%o' $(($n / 16777216)); n=$((n % 16777216))
+ printf '\\%o' $(($n / 65536)); n=$((n % 65536))
+ printf '\\%o' $(($n / 256)); n=$((n % 256))
+ printf '\\%o' $(($n ));
}
# Print the big-endian 4-byte binary representation of $1