code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
#
# Copyright (c) 2008 Matthew Ogilvie
# Parts adapted from other tests.
#
test_description='git-cvsserver -kb modes
tests -kb mode for binary files when accessing a git
repository using cvs CLI client via git-cvsserver server'
. ./test-lib.sh
marked_as () {
foundEntry="$(grep "^/$2/" "$1/CVS/Entries"... | Shell |
#!/bin/sh
test_description='rewrite diff on binary file'
. ./test-lib.sh
# We must be large enough to meet the MINIMUM_BREAK_SIZE
# requirement.
make_file() {
# common first line to help identify rewrite versus regular diff
printf "=\n" >file
for i in 1 2 3 4 5 6 7 8 9 10
do
for j in 1 2 3 4 5 6 7 8 9
do
... | Shell |
#!/bin/sh
test_description='push with --set-upstream'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-terminal.sh
ensure_fresh_upstream() {
rm -rf parent && git init --bare parent
}
test_expect_success 'setup bare parent' '
ensure_fresh_upstream &&
git remote add upstream parent
'
test_expect_success 'setup local commit... | Shell |
#!/bin/sh
die() {
echo >&2 "$@"
exit 1
}
xmkdir() {
while [ -n "$1" ]; do
[ -d "$1" ] || mkdir "$1" || die "Unable to mkdir $1"
shift
done
}
R="$1"
[ -n "$R" ] || die "Usage: prepare-chroot.sh <root>"
[ -x git ] || die "This script needs to be executed at git source code's top directory"
[ -x /bin/busybox ]... | Shell |
#!/bin/sh
# Copyright (c) 2011, Google Inc.
test_description='adding and checking out large blobs'
. ./test-lib.sh
test_expect_success setup '
# clone does not allow us to pass core.bigfilethreshold to
# new repos, so set core.bigfilethreshold globally
git config --global core.bigfilethreshold 200k &&
echo X | d... | Shell |
#!/bin/sh
test_description='diff function context'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh
cat <<\EOF >hello.c
#include <stdio.h>
static int a(void)
{
/*
* Dummy.
*/
}
static int hello_world(void)
{
/* Classic. */
printf("Hello world.\n");
/* Success! */
return 0;
}
static int b(void)
{
/*
* ... | Shell |
#!/bin/sh
test_description='magic pathspec tests using git-add'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir sub anothersub &&
: >sub/foo &&
: >anothersub/foo
'
test_expect_success 'add :/' "
cat >expected <<-EOF &&
add 'anothersub/foo'
add 'expected'
add 'sub/actual'
add 'sub/foo'
EOF
(cd sub && g... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Shawn Pearce
#
test_description='git reset should cull empty subdirs'
. ./test-lib.sh
test_expect_success \
'creating initial files' \
'mkdir path0 &&
cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
git add path0/COPYING &&
git commit -m add -a'
test_expect_su... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='Two way merge with read-tree -m $H $M
This test tries two-way merge (aka fast-forward with carry forward).
There is the head (called H) and another commit (called M), which is
simply ahead of H. The index and the work tree contains a state that
is ... | Shell |
#!/bin/sh
test_description='git pack-object --include-tag'
. ./test-lib.sh
TRASH=`pwd`
test_expect_success setup '
echo c >d &&
git update-index --add d &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` &&
echo "object $commit" >sig &&
echo "type commit" >>sig &&
echo "tag mytag" >>sig &&
... | Shell |
#!/bin/sh
test_description='rerere run in a workdir'
. ./test-lib.sh
test_expect_success SYMLINKS setup '
git config rerere.enabled true &&
>world &&
git add world &&
test_tick &&
git commit -m initial &&
echo hello >world &&
test_tick &&
git commit -a -m hello &&
git checkout -b side HEAD^ &&
echo goodby... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Thomas Rast
#
test_description='Test the post-rewrite hook.'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit A foo A &&
test_commit B foo B &&
test_commit C foo C &&
test_commit D foo D &&
git checkout A^0 &&
test_commit E bar E &&
test_commit F foo F &&
git checkout... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 David Reiss
#
test_description='Test various path utilities'
. ./test-lib.sh
norm_path() {
test_expect_success $3 "normalize path: $1 => $2" \
"test \"\$(test-path-utils normalize_path_copy '$1')\" = '$2'"
}
# On Windows, we are using MSYS's bash, which mangles the paths.
# Absolu... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Stephen Boyd
#
test_description='git apply --build-fake-ancestor handling.'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit 1 &&
test_commit 2 &&
mkdir sub &&
test_commit 3 sub/3.t &&
test_commit 4
'
test_expect_success 'apply --build-fake-ancestor' '
git checkout 2 ... | Shell |
#!/bin/sh
# Copyright (c) 2010, Jens Lehmann
test_description='Recursive "git fetch" for submodules'
. ./test-lib.sh
pwd=$(pwd)
add_upstream_commit() {
(
cd submodule &&
head1=$(git rev-parse --short HEAD) &&
echo new >> subfile &&
test_tick &&
git add subfile &&
git commit -m new subfile &&
head2=$(... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 David D. Kilzer
test_description='git svn info'
. ./lib-git-svn.sh
# Tested with: svn, version 1.4.4 (r25188)
# Tested with: svn, version 1.6.[12345689]
v=`svn_cmd --version | sed -n -e 's/^svn, version \(1\.[0-9]*\.[0-9]*\).*$/\1/p'`
case $v in
1.[456].*)
;;
*)
skip_all="skipping ... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Jakub Narebski, Christian Couder
#
test_description='Move a binary file'
. ./test-lib.sh
test_expect_success 'prepare repository' '
git init &&
echo foo > foo &&
echo "barQ" | q_to_nul > bar &&
git add . &&
git commit -m "Initial commit"
'
test_expect_success 'move the files i... | Shell |
#!/bin/sh
test_description='git am running'
. ./test-lib.sh
test_expect_success 'setup: messages' '
cat >msg <<-\EOF &&
second
Lorem ipsum dolor sit amet, consectetuer sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et ... | Shell |
#!/bin/sh
test_description='test unique sha1 abbreviation on "index from..to" line'
. ./test-lib.sh
cat >expect_initial <<EOF
100644 blob 51d2738463ea4ca66f8691c91e33ce64b7d41bb1 foo
EOF
cat >expect_update <<EOF
100644 blob 51d2738efb4ad8a1e40bed839ab8e116f0a15e47 foo
EOF
test_expect_success 'setup' '
echo 4827 > ... | Shell |
#!/bin/sh
test_description='diff --relative tests'
. ./test-lib.sh
test_expect_success 'setup' '
git commit --allow-empty -m empty &&
echo content >file1 &&
mkdir subdir &&
echo other content >subdir/file2 &&
git add . &&
git commit -m one
'
check_diff() {
expect=$1; shift
cat >expected <<EOF
diff --git a/$exp... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git ls-files -k and -m flags test.
This test prepares the following in the cache:
path0 - a file
path1 - a symlink
path2/file2 - a file in a directory
path3/file3 - a file in a directory
and the following on the filesyst... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Will Palmer
#
test_description='git merge-tree'
. ./test-lib.sh
test_expect_success setup '
test_commit "initial" "initial-file" "initial"
'
test_expect_success 'file add A, !B' '
cat >expected <<\EXPECTED &&
added in remote
their 100644 43d5a8ed6ef6c00ff775008633f95787d088285d ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='Test rename detection in diff engine.
'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh
echo >path0 'Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
line 11
Line 12
Line 13
Line 14
Line 15
'
test_expect_success \
'update-... | Shell |
#!/bin/sh
test_description='word diff colors'
. ./test-lib.sh
. "$TEST_DIRECTORY"/diff-lib.sh
cat >pre.simple <<-\EOF
h(4)
a = b + c
EOF
cat >post.simple <<-\EOF
h(4),hh[44]
a = b + c
aa = a
aeff = aeff * ( aaa )
EOF
cat >expect.letter-runs-are-words <<-\EOF
<BOLD>diff --git a/pre b/post<RESET>
<BOLD>ind... | Shell |
#!/bin/sh
test_description='test automatic tag following'
. ./test-lib.sh
if ! test_have_prereq NOT_MINGW; then
say "GIT_DEBUG_SEND_PACK not supported - skipping tests"
fi
# End state of the repository:
#
# T - tag1 S - tag2
# / /
# L - A ------ O ------ B
# \ \ ... | Shell |
#!/bin/sh
test_description='git p4 options'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
test_expect_success 'init depot' '
(
cd "$cli" &&
echo file1 >file1 &&
p4 add file1 &&
p4 submit -d "change 1" &&
echo file2 >file2 &&
p4 add file2 &&
p4 submit -d "change 2" &&
echo file3 >... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Santhosh Kumar Mani
test_description='git svn can fetch renamed directories'
. ./lib-git-svn.sh
test_expect_success 'load repository with renamed directory' '
svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9121/renamed-dir.dump
'
test_expect_success 'init and fetch repositor... | Shell |
#!/bin/sh
test_description='git branch display tests'
. ./test-lib.sh
test_expect_success 'make commits' '
echo content >file &&
git add file &&
git commit -m one &&
echo content >>file &&
git commit -a -m two
'
test_expect_success 'make branches' '
git branch branch-one &&
git branch branch-two HEAD^
'
test... | Shell |
#!/bin/sh
out_prefix=$(dirname "$0")/../test-results/valgrind.out
output=
count=0
total_count=0
missing_message=
new_line='
'
# start outputting the current valgrind error in $out_prefix.++$count,
# and the test case which failed in the corresponding .message file
start_output () {
test -z "$output" || return
# pr... | Shell |
#!/bin/sh
base=$(basename "$0")
TRACK_ORIGINS=
VALGRIND_VERSION=$(valgrind --version)
VALGRIND_MAJOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*\([0-9]*\)')
VALGRIND_MINOR=$(expr "$VALGRIND_VERSION" : '[^0-9]*[0-9]*\.\([0-9]*\)')
test 3 -gt "$VALGRIND_MAJOR" ||
test 3 -eq "$VALGRIND_MAJOR" -a 4 -gt "$VALGRIND_MINOR" ||
TR... | Shell |
#!/bin/sh
#
# Copyright (c) 2009, Red Hat Inc, Author: Michael S. Tsirkin (mst@redhat.com)
#
test_description='test clone --reference'
. ./test-lib.sh
base_dir=`pwd`
U=$base_dir/UPLOAD_LOG
test_expect_success 'preparing first repository' \
'test_create_repo A && cd A &&
echo first > file1 &&
git add file1 &&
git co... | Shell |
#!/bin/sh
test_description='basic ls-files tests
This test runs git ls-files with various unusual or malformed
command-line arguments.
'
. ./test-lib.sh
>empty
test_expect_success 'ls-files in empty repository' '
git ls-files >actual &&
test_cmp empty actual
'
test_expect_success 'ls-files with nonexistent path... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Shawn Pearce
#
test_description='mmap sliding window tests'
. ./test-lib.sh
test_expect_success \
'setup' \
'rm -f .git/index* &&
for i in a b c
do
echo $i >$i &&
test-genrandom "$i" 32768 >>$i &&
git update-index --add $i || return 1
... | Shell |
#!/bin/sh
test_description='various @{whatever} syntax tests'
. ./test-lib.sh
test_expect_success 'setup' '
test_commit one &&
test_commit two
'
check_at() {
echo "$2" >expect &&
git log -1 --format=%s "$1" >actual &&
test_cmp expect actual
}
test_expect_success '@{0} shows current' '
check_at @{0} two
'
tes... | Shell |
#!/bin/sh
test_description='external credential helper tests
This is a tool for authors of external helper tools to sanity-check
their helpers. If you have written the "git-credential-foo" helper,
you check it with:
make GIT_TEST_CREDENTIAL_HELPER=foo t0303-credential-external.sh
This assumes that your helper is ... | Shell |
#!/bin/sh
test_description='Test cherry-pick continuation features
+ conflicting: rewrites unrelated to conflicting
+ yetanotherpick: rewrites foo to e
+ anotherpick: rewrites foo to d
+ picked: rewrites foo to c
+ unrelatedpick: rewrites unrelated to reallyunrelated
+ base: rewrites foo to b
+ initial:... | Shell |
#!/bin/sh
test_description='
Miscellaneous tests for git ls-tree.
1. git ls-tree fails in presence of tree damage.
'
. ./test-lib.sh
test_expect_success 'setup' '
mkdir a &&
touch a/one &&
git add a/one &&
git commit -m test
'
test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Alec Berryman
test_description='git svn fetch repository with deleted and readded directory'
. ./lib-git-svn.sh
# Don't run this by default; it opens up a port.
require_svnserve
test_expect_success 'load repository' '
svnadmin load -q "$rawsvnrepo" < "$TEST_DIRECTORY"/t9126/foll... | Shell |
#!/bin/sh
test_description='commit-msg hook'
. ./test-lib.sh
test_expect_success 'with no hook' '
echo "foo" > file &&
git add file &&
git commit -m "first"
'
# set up fake editor for interactive editing
cat > fake-editor <<'EOF'
#!/bin/sh
cp FAKE_MSG "$1"
exit 0
EOF
chmod +x fake-editor
## Not using test_set... | Shell |
#!/bin/sh
test_description='test cherry-picking (and reverting) a root commit'
. ./test-lib.sh
test_expect_success setup '
echo first > file1 &&
git add file1 &&
test_tick &&
git commit -m "first" &&
git symbolic-ref HEAD refs/heads/second &&
rm .git/index file1 &&
echo second > file2 &&
git add file2 &&
... | Shell |
#!/bin/sh
test_description='tests for ref^{stuff}'
. ./test-lib.sh
test_expect_success 'setup' '
echo blob >a-blob &&
git tag -a -m blob blob-tag `git hash-object -w a-blob` &&
mkdir a-tree &&
echo moreblobs >a-tree/another-blob &&
git add . &&
TREE_SHA1=`git write-tree` &&
git tag -a -m tree tree-tag "$TREE_... | Shell |
#!/bin/sh
test_description='pulling from symlinked subdir'
. ./test-lib.sh
# The scenario we are building:
#
# trash\ directory/
# clone-repo/
# subdir/
# bar
# subdir-link -> clone-repo/subdir/
#
# The working directory is subdir-link.
test_expect_success SYMLINKS setup '
mkdir subdir &&
... | Shell |
# This is a phony Shell program that's only here to test xgettext
# message extraction
# so the above comment won't be folded into the next one by xgettext
echo
# TRANSLATORS: This is a test. You don't need to translate it.
gettext "TEST: A Shell test string"
# TRANSLATORS: This is a test. You don't need to translat... | Shell |
#!/bin/sh
test_description='apply same filename'
. ./test-lib.sh
modify () {
sed -e "$1" < "$2" > "$2".x &&
mv "$2".x "$2"
}
test_expect_success setup '
for i in a b c d e f g h i j k l m
do
echo $i
done >same_fn &&
cp same_fn other_fn &&
git add same_fn other_fn &&
git commit -m initial
'
test_expect_suc... | Shell |
#!/bin/sh
test_description='git remote porcelain-ish'
. ./test-lib.sh
setup_repository () {
mkdir "$1" && (
cd "$1" &&
git init &&
>file &&
git add file &&
test_tick &&
git commit -m "Initial" &&
git checkout -b side &&
>elif &&
git add elif &&
test_tick &&
git commit -m "Second" &&
git checkout master
... | Shell |
#!/bin/sh
test_description='test git rev-parse'
. ./test-lib.sh
test_rev_parse() {
name=$1
shift
test_expect_success "$name: is-bare-repository" \
"test '$1' = \"\$(git rev-parse --is-bare-repository)\""
shift
[ $# -eq 0 ] && return
test_expect_success "$name: is-inside-git-dir" \
"test '$1' = \"\$(git rev-... | Shell |
#!/bin/sh
test_description='basic credential helper tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-credential.sh
test_expect_success 'setup helper scripts' '
cat >dump <<-\EOF &&
whoami=`echo $0 | sed s/.*git-credential-//`
echo >&2 "$whoami: $*"
OIFS=$IFS
IFS==
while read key value; do
echo >&2 "$whoami: $ke... | Shell |
#!/bin/sh
test_description='git send-email'
. ./test-lib.sh
# May be altered later in the test
PREREQ="PERL"
test_expect_success $PREREQ \
'prepare reference tree' \
'echo "1A quick brown fox jumps over the" >file &&
echo "lazy dog" >>file &&
git add file &&
GIT_AUTHOR_NAME="A" git commit -a -... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Eric Wong
test_description='git svn dcommit clobber series'
. ./lib-git-svn.sh
test_expect_success 'initialize repo' '
mkdir import &&
(cd import &&
awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file
svn_cmd import -m "initial" . "$svnrepo"
) &&
git svn init "$svnrepo" &... | Shell |
#!/bin/sh
test_description='diff hunk fusing'
. ./test-lib.sh
f() {
echo $1
i=1
while test $i -le $2
do
echo $i
i=$(expr $i + 1)
done
echo $3
}
t() {
case $# in
4) hunks=$4; cmd="diff -U$3";;
5) hunks=$5; cmd="diff -U$3 --inter-hunk-context=$4";;
esac
label="$cmd, $1 common $2"
file=f$1
expected=ex... | Shell |
#!/bin/sh
test_description='test git rev-parse diagnosis for invalid argument'
exec </dev/null
. ./test-lib.sh
test_did_you_mean ()
{
sq="'" &&
cat >expected <<-EOF &&
fatal: Path '$2$3' $4, but not ${5:-$sq$3$sq}.
Did you mean '$1:$2$3'${2:+ aka $sq$1:./$3$sq}?
EOF
test_cmp expected error
}
HASH_file=
test... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
# Copyright (c) 2005 Robert Fitzsimons
#
test_description='git ls-tree directory and filenames handling.
This test runs git ls-tree with the following in a tree.
1.txt - a file
2.txt - a file
path0/a/b/c/1.txt - a file in a direct... | Shell |
#!/bin/sh
test_description='Test reflog display routines'
. ./test-lib.sh
test_expect_success 'setup' '
echo content >file &&
git add file &&
test_tick &&
git commit -m one
'
cat >expect <<'EOF'
Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
Reflog message: commit (initial): one
EOF
test_expect_success 'l... | Shell |
#!/bin/sh
# Based on a test case submitted by Björn Steinbrink.
test_description='git blame on conflicted files'
. ./test-lib.sh
test_expect_success 'setup first case' '
# Create the old file
echo "Old line" > file1 &&
git add file1 &&
git commit --author "Old Line <ol@localhost>" -m file1.a &&
# Branch
git c... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
#
test_description='test smart pushing over http via http-backend'
. ./test-lib.sh
if test -n "$NO_CURL"; then
skip_all='skipping test, git built without http support'
test_done
fi
ROOT_PATH="$PWD"
LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
. "$TEST_D... | Shell |
#!/bin/sh
find_file() {
cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
find $1 -type f |
sed -e 1q
}
config() {
git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" config $1 $2
}
test_expect_success 'setup repository' '
echo content >file &&
git add file &&
git commit -m one &&
mkdir "$HTTPD_DOCUMENT_ROOT_PATH/r... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes E. Schindelin
#
test_description='Test commit notes'
. ./test-lib.sh
cat > fake_editor.sh << \EOF
#!/bin/sh
echo "$MSG" > "$1"
echo "$MSG" >& 2
EOF
chmod a+x fake_editor.sh
GIT_EDITOR=./fake_editor.sh
export GIT_EDITOR
test_expect_success 'cannot annotate non-existing HEAD'... | Shell |
#!/bin/sh
test_description='--ancestry-path'
# D---E-------F
# / \ \
# B---C---G---H---I---J
# / \
# A-------K---------------L--M
#
# D..M == E F G H I J K L M
# --ancestry-path D..M == E F H I J L M
#
# D..M -- M.t == M
# --ance... | Shell |
#!/bin/sh
test_description='fetching and pushing project with subproject'
. ./test-lib.sh
test_expect_success setup '
test_tick &&
mkdir -p sub && (
cd sub &&
git init &&
>subfile &&
git add subfile &&
git commit -m "subproject commit #1"
) &&
>mainfile &&
git add sub mainfile &&
test_tick &&
git co... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Shawn O. Pearce
#
test_description='Test the update hook infrastructure.'
. ./test-lib.sh
test_expect_success setup '
echo This is a test. >a &&
git update-index --add a &&
tree0=$(git write-tree) &&
commit0=$(echo setup | git commit-tree $tree0) &&
echo We hope it works. >a &&
... | Shell |
#!/bin/sh
test_description='Basic subproject functionality'
. ./test-lib.sh
test_expect_success 'setup: create superproject' '
: >Makefile &&
git add Makefile &&
git commit -m "Superproject created"
'
test_expect_success 'setup: create subprojects' '
mkdir sub1 &&
( cd sub1 && git init && : >Makefile && git add... | Shell |
#!/bin/sh
test_description='Test am with auto.crlf'
. ./test-lib.sh
cat >patchfile <<\EOF
From 38be10072e45dd6b08ce40851e3fca60a31a340b Mon Sep 17 00:00:00 2001
From: Marius Storm-Olsen <x@y.com>
Date: Thu, 23 Aug 2007 13:00:00 +0200
Subject: test1
---
foo | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)... | Shell |
#!/bin/sh
#
# Helper functions to check if read-tree would succeed/fail as expected with
# and without the dry-run option. They also test that the dry-run does not
# write the index and that together with -u it doesn't touch the work tree.
#
read_tree_must_succeed () {
git ls-files -s >pre-dry-run &&
git read-t... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Shawn Pearce
#
test_description='git checkout-index --temp test.
With --temp flag, git checkout-index writes to temporary merge files
rather than the tracked path.'
. ./test-lib.sh
test_expect_success \
'preparation' '
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Eric Wong
# Based on a script by Joakim Tjernlund <joakim.tjernlund@transmode.se>
test_description='git svn dcommit handles merges'
. ./lib-git-svn.sh
big_text_block () {
cat << EOF
#
# (C) Copyright 2000 - 2005
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# See file CRE... | Shell |
#!/bin/sh
test_description='Test git notes prune'
. ./test-lib.sh
test_expect_success 'setup: create a few commits with notes' '
: > file1 &&
git add file1 &&
test_tick &&
git commit -m 1st &&
git notes add -m "Note #1" &&
: > file2 &&
git add file2 &&
test_tick &&
git commit -m 2nd &&
git notes add -m "N... | Shell |
#!/bin/sh
test_description='add -i basic tests'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-prereq-FILEMODE.sh
test_expect_success PERL 'setup (initial)' '
echo content >file &&
git add file &&
echo more >>file &&
echo lines >>file
'
test_expect_success PERL 'status works (initial)' '
git add -i </dev/null >output &... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Peter Collingbourne
#
test_description='git apply submodule tests'
. ./test-lib.sh
test_expect_success setup '
cat > create-sm.patch <<EOF &&
diff --git a/dir/sm b/dir/sm
new file mode 160000
index 0000000..0123456
--- /dev/null
+++ b/dir/sm
@@ -0,0 +1 @@
+Subproject commit 01234567... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Charles Bailey
#
test_description='git mergetool
Testing basic merge tool invocation'
. ./test-lib.sh
# All the mergetool test work by checking out a temporary branch based
# off 'branch1' and then merging in master and checking the results of
# running mergetool
test_expect_succes... | Shell |
#!/bin/sh
test_description='checkout into detached HEAD state'
. ./test-lib.sh
check_detached () {
test_must_fail git symbolic-ref -q HEAD >/dev/null
}
check_not_detached () {
git symbolic-ref -q HEAD >/dev/null
}
ORPHAN_WARNING='you are leaving .* commit.*behind'
PREV_HEAD_DESC='Previous HEAD position was'
check... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Junio C Hamano
#
test_description='per path merge controlled by merge attribute'
. ./test-lib.sh
test_expect_success setup '
for f in text binary union
do
echo Initial >$f && git add $f || break
done &&
test_tick &&
git commit -m Initial &&
git branch side &&
for f in text... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Jakub Narebski
#
gitweb_init () {
safe_pwd="$(perl -MPOSIX=getcwd -e 'print quotemeta(getcwd)')"
cat >gitweb_config.perl <<EOF
#!/usr/bin/perl
# gitweb configuration for tests
our \$version = 'current';
our \$GIT = 'git';
our \$projectroot = "$safe_pwd";
our \$project_maxdepth = 8;... | Shell |
#!/bin/sh
test_description='git-p4 rcs keywords'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
#
# Make one file with keyword lines at the top, and
# enough plain text to be able to test modifications
# far away from the keywords.
#
test_expect_success 'init depot' '
(
cd "$cli" &&
cat <<-\E... | Shell |
#!/bin/sh
echo >&2 "fatal: git was built without support for `basename $0` (@@REASON@@)."
exit 128
| Shell |
#!/bin/sh
USAGE='[help|start|bad|good|skip|next|reset|visualize|replay|log|run]'
LONG_USAGE='git bisect help
print this long help message.
git bisect start [--no-checkout] [<bad> [<good>...]] [--] [<pathspec>...]
reset bisect state and start bisection.
git bisect bad [<rev>]
mark <rev> a known-bad revision.
git bis... | Shell |
#!/bin/sh
usage () {
echo "usage:" $@
exit 127
}
die () {
echo $@
exit 128
}
if test $# -lt 2 || test $# -gt 3
then
usage "$0 <repository> <new_workdir> [<branch>]"
fi
orig_git=$1
new_workdir=$2
branch=$3
# want to make sure that what is pointed to has a .git directory ...
git_dir=$(cd "$orig_git" 2>/dev/null... | Shell |
#!/bin/sh
# Use this tool to rewrite your .git/remotes/ files into the config.
. git-sh-setup
if [ -d "$GIT_DIR"/remotes ]; then
echo "Rewriting $GIT_DIR/remotes" >&2
error=0
# rewrite into config
{
cd "$GIT_DIR"/remotes
ls | while read f; do
name=$(printf "$f" | tr -c "A-Za-z0-9-" ".")
sed -n \
-e ... | Shell |
#!/bin/sh
# Copyright 2008 Lukas Sandström <luksan@gmail.com>
#
# AppendPatch - A script to be used together with ExternalEditor
# for Mozilla Thunderbird to properly include patches inline in e-mails.
# ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2
CONFFILE=~/.appprc
SEP="-=-=-=-=-=-... | Shell |
#!/bin/sh
#
# An example hook script to verify if you are on battery, in case you
# are running Linux or OS X. Called by git-gc --auto with no arguments.
# The hook should exit with non-zero status after issuing an appropriate
# message if it wants to stop the auto repacking.
#
# This hook is stored in the contrib/hook... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Andy Parkins
#
# An example hook script to mail out commit update information. This hook
# sends emails listing new revisions to the repository introduced by the
# change being reported. The rule is that (for branch updates) each commit
# will appear on one email and one email only.
#... | Shell |
#!/bin/sh
# This script displays the distribution of longest common hash prefixes.
# This can be used to determine the minimum prefix length to use
# for object names to be unique.
git rev-list --objects --all | sort | perl -lne '
substr($_, 40) = "";
# uncomment next line for a distribution of bits instead of he... | Shell |
#!/bin/sh
#
# Copyright (c) 2012 Avery Pennaraum
#
test_description='Basic porcelain support for subtrees
This test verifies the basic operation of the merge, pull, add
and split subcommands of git subtree.
'
export TEST_DIRECTORY=$(pwd)/../../../t
. ../../../t/test-lib.sh
create()
{
echo "$1" >"$1"
git add "$1"
... | Shell |
#!/bin/bash
#
# git-subtree.sh: split/join git repositories in subdirectories of this one
#
# Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>
#
if [ $# -eq 0 ]; then
set -- -h
fi
OPTS_SPEC="\
git subtree add --prefix=<prefix> <commit>
git subtree merge --prefix=<prefix> <commit>
git subtree pull --prefix=... | Shell |
#!/bin/sh
USAGE="[-a] [-r] [-m] [-t] [-n] [-b <newname>] <name>"
LONG_USAGE="git-resurrect attempts to find traces of a branch tip
called <name>, and tries to resurrect it. Currently, the reflog is
searched for checkout messages, and with -r also merge messages. With
-m and -t, the history of all refs is scanned for... | Shell |
#!/bin/sh
if tty -s
then
echo "Run 'help' for help, or 'exit' to leave. Available commands:"
else
echo "Run 'help' for help. Available commands:"
fi
cd "$(dirname "$0")"
for cmd in *
do
case "$cmd" in
help) ;;
*) [ -f "$cmd" ] && [ -x "$cmd" ] && echo "$cmd" ;;
esac
done
| Shell |
#!/bin/sh
print_if_bare_repo='
if "$(git --git-dir="$1" rev-parse --is-bare-repository)" = true
then
printf "%s\n" "${1#./}"
fi
'
find -type d -name "*.git" -exec sh -c "$print_if_bare_repo" -- \{} \; -prune 2>/dev/null
| Shell |
#!/bin/sh
#
# Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
#
USAGE='[--mixed | --soft | --hard] [<commit-ish>] [ [--] <paths>...]'
SUBDIRECTORY_OK=Yes
. git-sh-setup
set_reflog_action "reset $*"
require_work_tree
update= reset_type=--mixed
unset rev
while test $# != 0
do
case "$1" in
--mixed | --soft... | Shell |
#!/bin/sh
#
# Copyright (c) 2006, Shawn O. Pearce
#
# Cleanup unreachable files and optimize the repository.
USAGE='[--prune]'
SUBDIRECTORY_OK=Yes
. git-sh-setup
no_prune=:
while test $# != 0
do
case "$1" in
--prune)
no_prune=
;;
--)
usage
;;
esac
shift
done
case "$(git config --get gc.packrefs)" in
not... | Shell |
#!/bin/sh
#
# Copyright (c) 2005, Linus Torvalds
# Copyright (c) 2005, Junio C Hamano
#
# Clone a repository into a different directory that does not yet exist.
# See git-sh-setup why.
unset CDPATH
OPTIONS_SPEC="\
git-clone [options] [--] <repo> [<dir>]
--
n,no-checkout don't create a checkout
bare ... | Shell |
#!/bin/sh
USAGE="(edit [-F <file> | -m <msg>] | show) [commit]"
. git-sh-setup
test -z "$1" && usage
ACTION="$1"; shift
test -z "$GIT_NOTES_REF" && GIT_NOTES_REF="$(git config core.notesref)"
test -z "$GIT_NOTES_REF" && GIT_NOTES_REF="refs/notes/commits"
MESSAGE=
while test $# != 0
do
case "$1" in
-m)
test "$AC... | Shell |
#!/bin/sh
#
usage () {
echo >&2 "usage: $0 [--heads] [--tags] [-u|--upload-pack <upload-pack>]"
echo >&2 " <repository> <refs>..."
exit 1;
}
die () {
echo >&2 "$*"
exit 1
}
exec=
while test $# != 0
do
case "$1" in
-h|--h|--he|--hea|--head|--heads)
heads=heads; shift ;;
-t|--t|--t... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Linus Torvalds
#
# Resolve two trees.
#
echo 'WARNING: This command is DEPRECATED and will be removed very soon.' >&2
echo 'WARNING: Please use git-merge or git-pull instead.' >&2
sleep 2
USAGE='<head> <remote> <merge-message>'
. git-sh-setup
dropheads() {
rm -f -- "$GIT_DIR/MERGE_H... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
# Pretend we resolved the heads, but declare our tree trumps everybody else.
#
# We need to exit with 2 if the index does not match our HEAD tree,
# because the current index is what we will be committing as the
# merge result.
git diff-index --quiet --cached HEAD -- ... | Shell |
#!/bin/sh
# Copyright (c) 2005 Linus Torvalds
USAGE='[-n [<num>]] -l [<pattern>] | [-a | -s | -u <key-id>] [-f | -d | -v] [-m <msg>] <tagname> [<head>]'
SUBDIRECTORY_OK='Yes'
. git-sh-setup
message_given=
annotate=
signed=
force=
message=
username=
list=
verify=
LINES=0
while test $# != 0
do
case "$1" in
-a)
... | Shell |
#!/bin/sh
#
USAGE='<fetch-options> <repository> <refspec>...'
SUBDIRECTORY_OK=Yes
. git-sh-setup
set_reflog_action "fetch $*"
cd_to_toplevel ;# probably unnecessary...
. git-parse-remote
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
LF='
'
IFS="$LF"
no_tags=
tags=
a... | Shell |
#!/bin/sh
USAGE='<tag>'
SUBDIRECTORY_OK='Yes'
. git-sh-setup
verbose=
while test $# != 0
do
case "$1" in
-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
verbose=t ;;
*)
break ;;
esac
shift
done
if [ "$#" != "1" ]
then
usage
fi
type="$(git cat-file -t "$1" 2>/dev/null)" ||
die "$1: no such object."
... | Shell |
#!/bin/sh
#
# Copyright (c) 2005-2006 Pavel Roskin
#
OPTIONS_KEEPDASHDASH=
OPTIONS_SPEC="\
git-clean [options] <paths>...
Clean untracked files from the working directory
When optional <paths>... arguments are given, the paths
affected are further limited to those that match them.
--
d remove directories as well
f o... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2006 Junio C Hamano
USAGE='[-a | --interactive] [-s] [-v] [--no-verify] [-m <message> | -F <logfile> | (-C|-c) <commit> | --amend] [-u] [-e] [--author <author>] [--template <file>] [[-i | -o] <path>...]'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
. git-sh-setup
re... | Shell |
#!/bin/sh
OPTIONS_KEEPDASHDASH=t
OPTIONS_SPEC="\
git-checkout [options] [<branch>] [<paths>...]
--
b= create a new branch started at <branch>
l create the new branch's reflog
track arrange that the new branch tracks the remote branch
f proceed even if the index or working tree is not... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2005 Junio C Hamano
#
case "$0" in
*-revert* )
test -t 0 && edit=-e
replay=
me=revert
USAGE='[--edit | --no-edit] [-n] <commit-ish>' ;;
*-cherry-pick* )
replay=t
edit=
me=cherry-pick
USAGE='[--edit] [-n] [-r] [-x] <commit-ish>' ;;
* )
echo >&2 "... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.