Skip to content

Commit 604bd08

Browse files
committed
Disable index compression for scd --unindex
Avoid race condition with a background index compression process.
1 parent a567a78 commit 604bd08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/scd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ _scd_Y19oug_compress() {
239239
240240
# Rewrite directory index if it is at least 20% oversized.
241241
local curhistsize
242-
if [[ -s $SCD_HISTFILE ]] && curhistsize=$(wc -l <$SCD_HISTFILE) && \
242+
if [[ -z $opt_unindex && -s $SCD_HISTFILE ]] && \
243+
curhistsize=$(wc -l <$SCD_HISTFILE) && \
243244
(( $curhistsize > 1.2 * $SCD_HISTSIZE )); then
244245
# Compress repeated entries in a background process.
245246
(

0 commit comments

Comments
 (0)