1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-02-03 13:21:56 +02:00

35 lines
741 B
Bash
Raw Normal View History

2022-03-26 21:18:10 +11:00
#!/bin/sh
set -e
cd $1
git init
git config user.email "CI@example.com"
git config user.name "CI"
# we're setting this to ensure that it's honoured by the fetch command
git config fetch.prune true
echo test1 > myfile1
git add .
git commit -am "myfile1"
git checkout -b other_branch
git checkout master
cd ..
git clone --bare ./actual actual_remote
cd actual
git remote add origin ../actual_remote
git fetch origin
git branch --set-upstream-to=origin/master master
git branch --set-upstream-to=origin/other_branch other_branch
# unbenownst to our test repo we're removing the branch on the remote, so upon
# fetching with prune: true we expect git to realise the remote branch is gone
git -C ../actual_remote branch -d other_branch