github.com/mhristof/go-stacks@v0.1.3/test-repo.sh (about)

     1  #!/usr/bin/env bash
     2  # http://redsymbol.net/articles/unofficial-bash-strict-mode/
     3  set -euo pipefail
     4  IFS=$'\n\t'
     5  
     6  function commit {
     7      git checkout "$1" || git checkout -b "$1"
     8      date >>"$1.md"
     9      git add "$1.md"
    10      git commit "$1.md" -m "$1: commiting"
    11  }
    12  
    13  rm -rf test-repo
    14  mkdir -p test-repo
    15  cd test-repo
    16  git init
    17  touch main.md
    18  git add main.md
    19  git commit main.md -m 'initial import'
    20  commit main
    21  commit main
    22  commit feat1
    23  commit feat1.1
    24  commit main
    25  commit feat1.1
    26  
    27  exit 0