File: 0000-gitconfig-home

package info (click to toggle)
git-publish 1.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: python: 861; sh: 281; makefile: 5
file content (27 lines) | stat: -rwxr-xr-x 775 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
# ensure git-config $HOME override is working as expected
#
# Copyright 2019 Red Hat, Inc.
#
# Authors:
#   Eduardo Habkost <ehabkost@redhat.com>
#
# This work is licensed under the MIT License.  Please see the LICENSE file or
# http://opensource.org/licenses/MIT.

source "$TESTS_DIR/functions.sh"

assert [ "$HOME" = "$RESULTS_DIR/home" ]

cat >> "$HOME/.gitconfig" <<EOF
[gitpublishtesting]
readingworks=yes
EOF

[ "$(git config --global --show-origin --list | grep readingworks)" = \
  "file:$HOME/.gitconfig	gitpublishtesting.readingworks=yes" ] || \
    abort "git config is not reading .gitconfig"

git config --global gitpublishtsting.writingworks yes
egrep -q 'writingworks *= *yes' "$HOME/.gitconfig" ||
	abort "Setting global config option didn't work"