interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t2007-checkout-symlink.sh

55 lines · 1016 bytes Raw Blame History
1#!/bin/sh
2#
3# Copyright (c) 2007 Junio C Hamano
4
5test_description='git checkout to switch between branches with symlink<->dir'
6
7GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
8export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
9
10. ./test-lib.sh
11
12test_expect_success setup '
13
14 mkdir frotz &&
15 echo hello >frotz/filfre &&
16 git add frotz/filfre &&
17 test_tick &&
18 git commit -m "main has file frotz/filfre" &&
19
20 git branch side &&
21
22 echo goodbye >nitfol &&
23 git add nitfol &&
24 test_tick &&
25 git commit -m "main adds file nitfol" &&
26
27 git checkout side &&
28
29 git rm --cached frotz/filfre &&
30 mv frotz xyzzy &&
31 test_ln_s_add xyzzy frotz &&
32 git add xyzzy/filfre &&
33 test_tick &&
34 git commit -m "side moves frotz/ to xyzzy/ and adds frotz->xyzzy/"
35
36'
37
38test_expect_success 'switch from symlink to dir' '
39
40 git checkout main
41
42'
43
44test_expect_success 'Remove temporary directories & switch to main' '
45 rm -fr frotz xyzzy nitfol &&
46 git checkout -f main
47'
48
49test_expect_success 'switch from dir to symlink' '
50
51 git checkout side
52
53'
54
55test_done