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 / t2005-checkout-index-symlinks.sh

30 lines · 722 bytes Raw Blame History
1#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
6test_description='git checkout-index on filesystem w/o symlinks test.
7
8This tests that git checkout-index creates a symbolic link as a plain
9file if core.symlinks is false.'
10
11. ./test-lib.sh
12
13test_expect_success \
14'preparation' '
15git config core.symlinks false &&
16l=$(printf file | git hash-object -t blob -w --stdin) &&
17echo "120000 $l symlink" | git update-index --index-info'
18
19test_expect_success \
20'the checked-out symlink must be a file' '
21git checkout-index symlink &&
22test -f symlink'
23
24test_expect_success 'the file must be the blob we added during the setup' '
25 echo "$l" >expect &&
26 git hash-object -t blob symlink >actual &&
27 test_cmp expect actual
28'
29
30test_done