Skip to content

Commit

Permalink
Remove unnecessary empty merge dir check
Browse files Browse the repository at this point in the history
  • Loading branch information
gliargovas committed Oct 11, 2023
1 parent 48f1454 commit ea744b1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions try
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,14 @@ try() {
for lower_dir in $LOWER_DIRS
do
temp_mountpoint="$lower_dir/upperdir$mountpoint"
# Check if the new mountpoint is a directory and is non-empty
if [ -d "$temp_mountpoint" ] && [ "$(find "$temp_mountpoint" -mindepth 1 -maxdepth 1 -print -quit)" ]; then
if [ -n "$new_mountpoint" ]; then
# If new_mountpoint is not empty, append : and the temp_mountpoint
new_mountpoint="$new_mountpoint:$temp_mountpoint"
else
# If new_mountpoint is empty, just set it to temp_mountpoint
new_mountpoint="$temp_mountpoint"
fi
if [ -n "$new_mountpoint" ]; then
# If new_mountpoint is not empty, append : and the temp_mountpoint
new_mountpoint="$new_mountpoint:$temp_mountpoint"
else
# If new_mountpoint is empty, just set it to temp_mountpoint
new_mountpoint="$temp_mountpoint"
fi
done

IFS=$OLDIFS
# Add the original mountpoint at the end
new_mountpoint="${new_mountpoint:+$new_mountpoint:}$mountpoint"
Expand Down

0 comments on commit ea744b1

Please sign in to comment.