File: t-cherry-pick-commits.sh

package info (click to toggle)
git-lfs 3.6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,808 kB
  • sloc: sh: 21,256; makefile: 507; ruby: 417
file content (36 lines) | stat: -rwxr-xr-x 708 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
#!/usr/bin/env bash

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

begin_test "cherry-pick two commits without lfs cache"
(
  set -e

  reponame="$(basename "$0" ".sh")-cherry-pick-commits"
  setup_remote_repo "$reponame"
  clone_repo "$reponame" cherrypickcommits

  git lfs track "*.dat"
  git add .gitattributes
  git commit -m "initial commit"

  git branch secondbranch

  echo "smudge a" > a.dat
  git add a.dat
  git commit -m "add a.dat"
  commit1=$(git log -n1 --format="%H")

  echo "smudge b" > b.dat
  git add b.dat
  git commit -m "add a.dat"
  commit2=$(git log -n1 --format="%H")

  git push origin main

  git checkout secondbranch
  rm -rf .git/lfs/objects

  git cherry-pick $commit1 $commit2
)
end_test