<commit_before>#!/usr/bin/env bash

. "test/testlib.sh"

begin_test "install again"
(
  set -e

  smudge="$(git config filter.lfs.smudge)"
  clean="$(git config filter.lfs.clean)"
  filter="$(git config filter.lfs.process)"

  printf "$smudge" | grep "git-lfs smudge"
  printf "$clean" | grep "git-lfs clean"
  printf "$filter" | grep "git-lfs filter"

  git lfs install

  [ "$smudge" = "$(git config filter.lfs.smudge)" ]
  [ "$clean" = "$(git config filter.lfs.clean)" ]
  [ "$filter" = "$(git config filter.lfs.process)" ]
)
end_test

begin_test "install with old (non-upgradeable) settings"
(
  set -e

  git config --global filter.lfs.smudge "git-lfs smudge --something %f"
  git config --global filter.lfs.clean "git-lfs clean --something %f"

  set +e
  git lfs install 2> install.log
  res=$?
  set -e<commit_msg>test/install: grep against `filter-process`, not `filter`<commit_after>#!/usr/bin/env bash

. "test/testlib.sh"

begin_test "install again"
(
  set -e

  smudge="$(git config filter.lfs.smudge)"
  clean="$(git config filter.lfs.clean)"
  filter="$(git config filter.lfs.process)"

  printf "$smudge" | grep "git-lfs smudge"
  printf "$clean" | grep "git-lfs clean"
  printf "$filter" | grep "git-lfs filter-process"

  git lfs install

  [ "$smudge" = "$(git config filter.lfs.smudge)" ]
  [ "$clean" = "$(git config filter.lfs.clean)" ]
  [ "$filter" = "$(git config filter.lfs.process)" ]
)
end_test

begin_test "install with old (non-upgradeable) settings"
(
  set -e

  git config --global filter.lfs.smudge "git-lfs smudge --something %f"
  git config --global filter.lfs.clean "git-lfs clean --something %f"

  set +e
  git lfs install 2> install.log
  res=$?
  set -e
{'fraction_non_alphanumeric': 0.16568396226415094, 'fraction_numerical': 0.0011792452830188679, 'mean_word_length': 3.549597855227882, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5791411', 'n_tokens_mistral': 650, 'n_tokens_neox': 610, 'n_words': 168}