File: t-track-attrs.sh

package info (click to toggle)
git-lfs 3.3.0-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,676 kB
  • sloc: sh: 19,133; makefile: 487; ruby: 228
file content (37 lines) | stat: -rwxr-xr-x 762 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash

. "$(dirname "$0")/testlib.sh"

ensure_git_version_isnt $VERSION_LOWER "2.1.0"

begin_test "track (--no-modify-attrs)"
(
  set -e

  reponame="track-no-modify-attrs"
  git init "$reponame"
  cd "$reponame"

  echo "contents" > a.dat
  git add a.dat

  # Git assumes that identical results from `stat(1)` between the index and
  # working copy are stat dirty. To prevent this, wait at least one second to
  # yield different `stat(1)` results.
  sleep 1

  git commit -m "add a.dat"

  echo "*.dat filter=lfs diff=lfs merge=lfs -text" > .gitattributes

  git add .gitattributes
  git commit -m "asdf"

  [ -z "$(git status --porcelain)" ]

  git lfs track --no-modify-attrs "*.dat"

  [ " M a.dat" = "$(git status --porcelain)" ]
)
end_test