@matheusbsbs / matheus-bagliano / commits / 1b8f39fb0d
Fork 0

t5540: make hash size independent

Use regex values based on $OID_REGEX instead of hard-coding them based on expected object ID lengths. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Dec 21, 2019 at 19:49 UTC 1b8f39fb0d2e9250a9867a6e498a33419ad7ab9f
1 file changed +2 -4
t/t5540-http-push-webdav.sh
+2 -4
@@ -134,15 +134,13 @@ test_expect_success 'MKCOL sends directory names with trailing slashes' '
134
135 x1="[0-9a-f]"
136 x2="$x1$x1"
137 -x5="$x1$x1$x1$x1$x1"
138 -x38="$x5$x5$x5$x5$x5$x5$x5$x1$x1$x1"
139 -x40="$x38$x2"
137 +xtrunc=$(echo $OID_REGEX | sed -e "s/\[0-9a-f\]\[0-9a-f\]//")
138
139 test_expect_success 'PUT and MOVE sends object to URLs with SHA-1 hash suffix' '
140 sed \
141 -e "s/PUT /OP /" \
142 -e "s/MOVE /OP /" \
145 - -e "s|/objects/$x2/${x38}_$x40|WANTED_PATH_REQUEST|" \
143 + -e "s|/objects/$x2/${xtrunc}_$OID_REGEX|WANTED_PATH_REQUEST|" \
144 "$HTTPD_ROOT_PATH"/access.log |
145 grep -e "\"OP .*WANTED_PATH_REQUEST HTTP/[.0-9]*\" 20[0-9] "
146