code stringlengths 1 1.96M | language stringclasses 1
value |
|---|---|
#!/bin/sh
# START-COMMIT HOOK
#
# The start-commit hook is invoked before a Subversion txn is created
# in the process of doing a commit. Subversion runs this hook
# by invoking a program (script, executable, binary, etc.) named
# 'start-commit' (for which this file is a template)
# with the following ordered... | Shell |
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# f... | Shell |
#!/bin/sh
# POST-LOCK HOOK
#
# The post-lock hook is run after a path is locked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-lock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repos... | Shell |
#!/bin/sh
# POST-LOCK HOOK
#
# The post-lock hook is run after a path is locked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-lock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this repos... | Shell |
#!/bin/sh
# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the pat... | Shell |
#!/bin/sh
# POST-UNLOCK HOOK
#
# The post-unlock hook runs after a path is unlocked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-unlock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this... | Shell |
#!/bin/sh
# PRE-COMMIT HOOK
#
# The pre-commit hook is invoked before a Subversion txn is
# committed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-commit' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (t... | Shell |
#!/bin/sh
# PRE-UNLOCK HOOK
#
# The pre-unlock hook is invoked before an exclusive lock is
# destroyed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-unlock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH ... | Shell |
#!/bin/sh
# POST-REVPROP-CHANGE HOOK
#
# The post-revprop-change hook is invoked after a revision property
# has been added, modified or deleted. Subversion runs this hook by
# invoking a program (script, executable, binary, etc.) named
# 'post-revprop-change' (for which this file is a template), with the
# f... | Shell |
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this rep... | Shell |
#!/bin/sh
# START-COMMIT HOOK
#
# The start-commit hook is invoked before a Subversion txn is created
# in the process of doing a commit. Subversion runs this hook
# by invoking a program (script, executable, binary, etc.) named
# 'start-commit' (for which this file is a template)
# with the following ordered... | Shell |
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following or... | Shell |
#!/bin/sh
# PRE-LOCK HOOK
#
# The pre-lock hook is invoked before an exclusive lock is
# created. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-lock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (the pat... | Shell |
#!/bin/sh
# PRE-UNLOCK HOOK
#
# The pre-unlock hook is invoked before an exclusive lock is
# destroyed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-unlock' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH ... | Shell |
#!/bin/sh
# POST-COMMIT HOOK
#
# The post-commit hook is invoked after a commit. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-commit' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this rep... | Shell |
#!/bin/sh
# PRE-COMMIT HOOK
#
# The pre-commit hook is invoked before a Subversion txn is
# committed. Subversion runs this hook by invoking a program
# (script, executable, binary, etc.) named 'pre-commit' (for which
# this file is a template), with the following ordered arguments:
#
# [1] REPOS-PATH (t... | Shell |
#!/bin/sh
# PRE-REVPROP-CHANGE HOOK
#
# The pre-revprop-change hook is invoked before a revision property
# is added, modified or deleted. Subversion runs this hook by invoking
# a program (script, executable, binary, etc.) named 'pre-revprop-change'
# (for which this file is a template), with the following or... | Shell |
#!/bin/sh
# POST-UNLOCK HOOK
#
# The post-unlock hook runs after a path is unlocked. Subversion runs
# this hook by invoking a program (script, executable, binary, etc.)
# named 'post-unlock' (for which this file is a template) with the
# following ordered arguments:
#
# [1] REPOS-PATH (the path to this... | Shell |
gcc -o main main.c block/block.c blockmap/blockmap.c dir/dir.c filesystem/fs.c message/message.c util/util.c superblock/Superblock.c inode/inode.c
| Shell |
#!/bin/bash
INDIR=$1
OUTDIR=$2
ERRORS=0
for fn in $INDIR/*.cg
do
name=`basename $fn .cg`
echo "Converting $fn -> $OUTDIR/$name.glsl"
cgc -ogles -C -profile glslf -profileopts version=120,userTexCoord=v_texCoord -o "$OUTDIR/$name.glsl" -entry main_fragment "$fn"
if [ $? != 0 ]; then
echo "Fail"
ERRORS=`expr $E... | Shell |
#!/bin/bash
TMPFILE=`tempfile`
for fn in ./*.glsl
do
name=`basename $fn .cg`
sed "s/sampler2D .*;/sampler2D s_texture;/g" $fn > $TMPFILE
mv $TMPFILE $fn
sed "s/gl_TexCoord\[0\]/v_texCoord/g" $fn > $TMPFILE
mv $TMPFILE $fn
done
| Shell |
#!/bin/bash
nArch="tp0"
nInArch="in.bin"
n2Arch="2.bin"
n16Arch="16.hex"
nTest16Arch="test_16.hex"
nTest2Arch="test_2.bin"
function bin_to_hex(){
od -tx1 -An ${nInArch} | tr -d ' \t\r\f\n' > ${nTest16Arch}
./${nArch} -a encode -i ${nInArch} -o ${n16Arch}
}
function hex_to_bin(){
./${nArch} -a decode -i ${n16Arch} -o ... | Shell |
n=1;
while :; do
head -c $n </dev/urandom >/tmp/in.bin;
./tp0 -a encode -i /tmp/in.bin -o /tmp/out.b16;
./tp0 -a decode -i /tmp/out.b16 -o /tmp/out.bin;
if diff /tmp/in.bin /tmp/out.bin; then :; else
echo ERROR: $n;
break;
fi
echo ok: $n;
n="‘expr $n + 1‘";
rm -f /tmp/in.bin /tmp/out.b16 /tmp/out.bin
done
| Shell |
#!/bin/bash
nArch="tp0"
nInArch="in.bin"
n2Arch="2.bin"
n16Arch="16.hex"
nTest16Arch="test_16.hex"
nTest2Arch="test_2.bin"
function bin_to_hex(){
od -tx1 -An ${nInArch} | tr -d ' \t\r\f\n' > ${nTest16Arch}
./${nArch} -a encode -i ${nInArch} -o ${n16Arch}
}
function hex_to_bin(){
./${nArch} -a decode -i ${n16Arch} -o ... | Shell |
#! /bin/sh
n=1;
while :; do
head -c $n </dev/urandom >/tmp/in.bin;
./tp1 -a encode -i /tmp/in.bin -o /tmp/out.b16;
./tp1 -a decode -i /tmp/out.b16 -o /tmp/out.bin;
if diff /tmp/in.bin /tmp/out.bin; then :; else
echo ERROR: $n;
break;
fi
... | Shell |
#!/bin/bash
nArch="tp1"
nInArch="in.bin"
n2Arch="2.bin"
n16Arch="16.hex"
nTest16Arch="test_16.hex"
nTest2Arch="test_2.bin"
function bin_to_hex(){
hexdump -v -e '1/1 "%02x"' ${nInArch} > ${nTest16Arch}
./${nArch} -a encode -i ${nInArch} -o ${n16Arch}
}
function hex_to_bin(){
./${nArch} -a decode -i ${n16Arch} -o ${n2... | Shell |
#! /bin/sh
n=1;
while :; do
head -c $n </dev/urandom >/tmp/in.bin;
./tp1 -a encode -i /tmp/in.bin -o /tmp/out.b16;
./tp1 -a decode -i /tmp/out.b16 -o /tmp/out.bin;
if diff /tmp/in.bin /tmp/out.bin; then :; else
echo ERROR: $n;
break;
fi
... | Shell |
#!/bin/bash
nArch="tp1"
nInArch="in.bin"
n2Arch="2.bin"
n16Arch="16.hex"
nTest16Arch="test_16.hex"
nTest2Arch="test_2.bin"
function bin_to_hex(){
hexdump -v -e '1/1 "%02x"' ${nInArch} > ${nTest16Arch}
./${nArch} -a encode -i ${nInArch} -o ${n16Arch}
}
function hex_to_bin(){
./${nArch} -a decode -i ${n16Arch} -o ${n2... | Shell |
#!/bin/bash
#
# update_locales.sh
#
# Created on: 29.07.2010
# Author: Mike Shatohin (brunql)
# Description: Updating translation files for Lightpack project
#
# Lightpack is very simple implementation of the backlight for a laptop
#
# Copyright (c) 2010 Mike Shatohin, mikeshatohin [at] gmail.com
#
# Ligh... | Shell |
#!/bin/bash
mv LightpackDrivePB LightpackDrivePB.app &&
cp LightpackDrivePB.app '/media/68FF-68CE/applications/LightpackDrivePB.app'
| Shell |
#!/bin/sh
cmake -DCMAKE_BUILD_TYPE=Release -DTARGET_TYPE=ARM
make
| Shell |
#!/bin/sh
cmake -DCMAKE_BUILD_TYPE=Debug -DTARGET_TYPE=Linux
make
| Shell |
#!/bin/sh
#
# Copyright (c) 2005 Linus Torvalds
# Copyright (c) 2005 Junio C Hamano
#
# Resolve two trees, using enhanced multi-base read-tree.
# The first parameters up to -- are merge bases; the rest are heads.
bases= head= remotes= sep_seen=
for arg
do
case ",$sep_seen,$head,$arg," in
*,--,)
sep_seen=yes
;;
... | Shell |
#!/bin/sh
#
# This program launch a web browser on the html page
# describing a git command.
#
# Copyright (c) 2007 Christian Couder
# Copyright (c) 2006 Theodore Y. Ts'o
#
# This file is heavily stolen from git-mergetool.sh, by
# Theodore Y. Ts'o (thanks) that is:
#
# Copyright (c) 2006 Theodore Y. Ts'o
#
# This file ... | Shell |
#!/bin/sh
dd if=/dev/zero bs=1048576 count=100 2>/dev/null |
/usr/bin/time ./test-sha1 >/dev/null
while read expect cnt pfx
do
case "$expect" in '#'*) continue ;; esac
actual=`
{
test -z "$pfx" || echo "$pfx"
dd if=/dev/zero bs=1048576 count=$cnt 2>/dev/null |
perl -pe 'y/\000/g/'
} | ./test-sha1 $cnt
... | Shell |
#!/bin/sh
#
# This program resolves merge conflicts in git
#
# Copyright (c) 2006 Theodore Y. Ts'o
#
# This file is licensed under the GPL v2, or a later version
# at the discretion of Junio C Hamano.
#
USAGE='[--tool=tool] [-y|--no-prompt|--prompt] [file to merge] ...'
SUBDIRECTORY_OK=Yes
OPTIONS_SPEC=
TOOL_MODE=merg... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
# Fetch one or more remote refs and merge it/them into the current HEAD.
USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
LONG_USAGE='Fetch one or more remote refs and merge it/them into the curren... | Shell |
#!/bin/sh
bindir="$1"
gitexecdir="$2"
gitcmd="$3"
if test "$bindir" != "$gitexecdir" -a -x "$gitcmd"
then
echo
echo "!! You have installed git-* commands to new gitexecdir."
echo "!! Old version git-* commands still remain in bindir."
echo "!! Mixing two versions of Git will lead to problems."
echo "!! Please remo... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
# Resolve two or more trees.
#
LF='
'
die () {
echo >&2 "$*"
exit 1
}
# The first parameters up to -- are merge bases; the rest are heads.
bases= head= remotes= sep_seen=
for arg
do
case ",$sep_seen,$head,$arg," in
*,--,)
sep_seen=yes
;;
,yes,,*)
hea... | Shell |
#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by "git commit" with one argument, the name of the file
# that has the commit message. The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit. The hook is allowed to edit the commi... | Shell |
#!/bin/sh
#
# An example hook script to check the commit log message taken by
# applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit. The hook is
# allowed to edit the commit message file.
#
# To enable this hook, rename ... | Shell |
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over
# dumb transports.
#
# To enable this hook, rename this file to "post-update".
exec git update-server-info
| Shell |
#!/bin/sh
#
# An example hook script to prepare the commit log message.
# Called by "git commit" with the name of the file that has the
# commit message, followed by the description of the commit
# message's source. The hook's purpose is to edit the commit
# message file. If the hook fails with a non-zero status,
# t... | Shell |
#!/bin/sh
#
# An example hook script to blocks unannotated tags from entering.
# Called by "git receive-pack" with arguments: refname sha1-old sha1-new
#
# To enable this hook, rename this file to "update".
#
# Config
# ------
# hooks.allowunannotated
# This boolean sets whether unannotated tags will be allowed into ... | Shell |
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --ver... | Shell |
#!/bin/sh
#
# Copyright (c) 2006, 2008 Junio C Hamano
#
# The "pre-rebase" hook is run just before "git rebase" starts doing
# its job, and can prevent the command from running by exiting with
# non-zero status.
#
# The hook is called with the following parameters:
#
# $1 -- the upstream the series was forked from.
# $... | Shell |
#!/bin/sh
#
# An example hook script to verify what is about to be committed
# by applypatch from an e-mail message.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-applypatch".
. git-sh-setup
test -x... | Shell |
#!/bin/sh
# Copyright (c) 2007, Nanako Shiraishi
dashless=$(basename "$0" | sed -e 's/-/ /')
USAGE="list [<options>]
or: $dashless show [<stash>]
or: $dashless drop [-q|--quiet] [<stash>]
or: $dashless ( pop | apply ) [--index] [-q|--quiet] [<stash>]
or: $dashless branch <branchname> [<stash>]
or: $dash... | Shell |
#!/bin/sh
# git-difftool--helper is a GIT_EXTERNAL_DIFF-compatible diff tool launcher.
# This script is typically launched by using the 'git difftool'
# convenience command.
#
# Copyright (c) 2009, 2010 David Aguilar
TOOL_MODE=diff
. git-mergetool--lib
# difftool.prompt controls the default prompt/no-prompt behavior
... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Junio C Hamano.
#
. git-sh-setup
prec=4
read_state () {
onto_name=$(cat "$state_dir"/onto_name) &&
end=$(cat "$state_dir"/end) &&
msgnum=$(cat "$state_dir"/msgnum)
}
continue_merge () {
test -d "$state_dir" || die "$state_dir directory does not exist"
unmerged=$(git ls-files -... | Shell |
#!/bin/sh
#
# Copyright (c) 2005, 2006 Junio C Hamano
SUBDIRECTORY_OK=Yes
OPTIONS_KEEPDASHDASH=
OPTIONS_SPEC="\
git am [options] [(<mbox>|<Maildir>)...]
git am [options] (--resolved | --skip | --abort)
--
i,interactive run interactively
b,binary* (historical option -- no-op)
3,3way allow fall back on ... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes E. Schindelin
#
test_description='Test custom diff function name patterns'
. ./test-lib.sh
LF='
'
cat >Beer.java <<\EOF
public class Beer
{
int special;
public static void main(String args[])
{
String s=" ";
for(int x = 99; x > 0; x--)
{
System.out.print(x + " bo... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='commit and log output encodings'
. ./test-lib.sh
compare_with () {
git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current &&
case "$3" in
'')
test_cmp "$2" current ;;
?*)
iconv -f "$3" -t UTF-8 >current.utf8 <current &&
iconv -f "$3" -t... | Shell |
#!/bin/sh
test_description='git p4 tests'
. ./lib-git-p4.sh
test_expect_success 'start p4d' '
start_p4d
'
test_expect_success 'add p4 files' '
(
cd "$cli" &&
echo file1 >file1 &&
p4 add file1 &&
p4 submit -d "file1" &&
echo file2 >file2 &&
p4 add file2 &&
p4 submit -d "file2"
)
'
test_expect_succe... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes E Schindelin
#
test_description='Test git stash'
. ./test-lib.sh
test_expect_success 'stash some dirty working directory' '
echo 1 > file &&
git add file &&
test_tick &&
git commit -m initial &&
echo 2 > file &&
git add file &&
echo 3 > file &&
test_tick &&
git stas... | Shell |
#!/bin/sh
test_description='git add --all'
. ./test-lib.sh
test_expect_success setup '
(
echo .gitignore
echo will-remove
) >expect &&
(
echo actual
echo expect
echo ignored
) >.gitignore &&
>will-remove &&
git add --all &&
test_tick &&
git commit -m initial &&
git ls-files >actual &&
test_cmp ex... | Shell |
#!/bin/sh
test_description='Test merge without common ancestors'
. ./test-lib.sh
# This scenario is based on a real-world repository of Shawn Pearce.
# 1 - A - D - F
# \ X /
# B X
# X \
# 2 - C - E - G
GIT_COMMITTER_DATE="2006-12-12 23:28:00 +0100"
export GIT_COMMITTER_DATE
test_expect_success ... | Shell |
#!/bin/sh
test_description='git merge
Testing octopus merge when reducing parents to independent branches.'
. ./test-lib.sh
# 0 - 1
# \ 2
# \ 3
# \ 4 - 5
#
# So 1, 2, 3 and 5 should be kept, 4 should be avoided.
test_expect_success 'setup' '
echo c0 > c0.c &&
git add c0.c &&
git commit -m c0 &&
git tag c... | Shell |
#!/bin/sh
test_description='test config file include directives'
. ./test-lib.sh
test_expect_success 'include file by absolute path' '
echo "[test]one = 1" >one &&
echo "[include]path = \"$(pwd)/one\"" >.gitconfig &&
echo 1 >expect &&
git config test.one >actual &&
test_cmp expect actual
'
test_expect_success '... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Brian C Gernhardt
#
test_description='Format-patch numbering options'
. ./test-lib.sh
test_expect_success setup '
echo A > file &&
git add file &&
git commit -m First &&
echo B >> file &&
git commit -a -m Second &&
echo C >> file &&
git commit -a -m Third
'
# Each of thes... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git ls-files test (--others should pick up symlinks).
This test runs git ls-files --others with the following on the
filesystem.
path0 - a file
path1 - a symlink
path2/file2 - a file in a directory
path3-junk - a file to confu... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Junio C Hamano
#
test_description='Quoting paths in diff output.
'
. ./test-lib.sh
P0='pathname'
P1='pathname with HT'
P2='pathname with SP'
P3='pathname
with LF'
if : 2>/dev/null >"$P1" && test -f "$P1" && rm -f "$P1"
then
test_set_prereq TABS_IN_FILENAMES
else
say 'Your filesyste... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Johannes Schindelin
#
test_description='Test git rev-parse with different parent options'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions
date >path0
git update-index --add path0
save_tag tree git write-tree
hide_error save_tag start unique_commit "start" ... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Eric Wong
#
test_description='git apply should not get confused with type changes.
'
. ./test-lib.sh
test_expect_success SYMLINKS 'setup repository and commits' '
echo "hello world" > foo &&
echo "hi planet" > bar &&
git update-index --add foo bar &&
git commit -m initial &&
gi... | Shell |
#!/bin/sh
# Copyright (c) 2006 Eric Wong
test_description='git svn metadata migrations from previous versions'
. ./lib-git-svn.sh
test_expect_success 'setup old-looking metadata' '
cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn &&
mkdir import &&
(
cd import &&
for i in trunk branches/a branches/b tags/0.1 ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Johannes Schindelin
#
test_description='Testing multi_ack pack fetching'
. ./test-lib.sh
# Test fetch-pack/upload-pack pair.
# Some convenience functions
add () {
name=$1 &&
text="$@" &&
branch=`echo $name | sed -e 's/^\(.\).*$/\1/'` &&
parents="" &&
shift &&
while test $1; ... | Shell |
. ./test-lib.sh
remotes_git_svn=remotes/git""-svn
git_svn_id=git""-svn-id
if test -n "$NO_SVN_TESTS"
then
skip_all='skipping git svn tests, NO_SVN_TESTS defined'
test_done
fi
if ! test_have_prereq PERL; then
skip_all='skipping git svn tests, perl not available'
test_done
fi
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR... | Shell |
#!/bin/sh
#
# Copyright (c) 2010 Ævar Arnfjörð Bjarmason
#
. ./test-lib.sh
GIT_TEXTDOMAINDIR="$GIT_BUILD_DIR/po/build/locale"
GIT_PO_PATH="$GIT_BUILD_DIR/po"
export GIT_TEXTDOMAINDIR GIT_PO_PATH
. "$GIT_BUILD_DIR"/git-sh-i18n
if test_have_prereq GETTEXT && ! test_have_prereq GETTEXT_POISON
then
# is_IS.UTF-8 on So... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Junio C Hamano
#
test_description='git read-tree --prefix test.
'
. ./test-lib.sh
test_expect_success setup '
echo hello >one &&
git update-index --add one &&
tree=`git write-tree` &&
echo tree is $tree
'
echo 'one
two/one' >expect
test_expect_success 'read-tree --prefix' '
gi... | Shell |
#!/bin/sh
test_description='tracking branch update checks for git push'
. ./test-lib.sh
test_expect_success 'setup' '
echo 1 >file &&
git add file &&
git commit -m 1 &&
git branch b1 &&
git branch b2 &&
git branch b3 &&
git clone . aa &&
git checkout b1 &&
echo b1 >>file &&
git commit -a -m b1 &&
git chec... | Shell |
#!/bin/sh
test_description="git-grep performance in various modes"
. ./perf-lib.sh
test_perf_large_repo
test_checkout_worktree
test_perf 'grep worktree, cheap regex' '
git grep some_nonexistent_string || :
'
test_perf 'grep worktree, expensive regex' '
git grep "^.* *some_nonexistent_string$" || :
'
test_perf 'gr... | Shell |
#!/bin/sh
case "$1" in
--help)
echo "usage: $0 [other_git_tree...] [--] [test_scripts]"
exit 0
;;
esac
die () {
echo >&2 "error: $*"
exit 1
}
run_one_dir () {
if test $# -eq 0; then
set -- p????-*.sh
fi
echo "=== Running $# tests in ${GIT_TEST_INSTALLED:-this tree} ==="
for t in "$@"; do
./$t $GIT_T... | Shell |
#!/bin/sh
test_description='Tests whether perf-lib facilities work'
. ./perf-lib.sh
test_perf_default_repo
test_perf 'test_perf_default_repo works' '
foo=$(git rev-parse HEAD) &&
test_export foo
'
test_checkout_worktree
test_perf 'test_checkout_worktree works' '
wt=$(find . | wc -l) &&
idx=$(git ls-files | wc ... | Shell |
#!/bin/sh
test_description="Tests diff generation performance"
. ./perf-lib.sh
test_perf_default_repo
test_perf 'log -3000 (baseline)' '
git log -3000 >/dev/null
'
test_perf 'log --raw -3000 (tree-only)' '
git log --raw -3000 >/dev/null
'
test_perf 'log -p -3000 (Myers)' '
git log -p -3000 >/dev/null
'
test_p... | Shell |
#!/bin/sh
#
# Copyright (c) 2011 Thomas Rast
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distr... | Shell |
#!/bin/sh
test_description="Tests history walking performance"
. ./perf-lib.sh
test_perf_default_repo
test_perf 'rev-list --all' '
git rev-list --all >/dev/null
'
test_perf 'rev-list --all --objects' '
git rev-list --all --objects >/dev/null
'
test_done
| Shell |
#!/bin/sh
test_description='ancestor culling and limiting by parent number'
. ./test-lib.sh
check_revlist () {
rev_list_args="$1" &&
shift &&
git rev-parse "$@" >expect &&
git rev-list $rev_list_args --all >actual &&
test_cmp expect actual
}
test_expect_success setup '
touch file &&
git add file &&
test_c... | Shell |
#!/bin/sh
test_description='common tail optimization'
. ./test-lib.sh
z=zzzzzzzz ;# 8
z="$z$z$z$z$z$z$z$z" ;# 64
z="$z$z$z$z$z$z$z$z" ;# 512
z="$z$z$z$z" ;# 2048
z2047=$(expr "$z" : '.\(.*\)') ; #2047
x=zzzzzzzzzz ;# 10
y="$x$x$x$x$x$x$x$x$x$x" ;# 100
z="$y$y$y$y$y$y$y$y$y$y" ;# 1000
z1000=$z
z100=$y
z10=$x
zs()... | Shell |
#!/bin/sh
test_description='test separate work tree'
. ./test-lib.sh
test_expect_success 'setup' '
EMPTY_TREE=$(git write-tree) &&
EMPTY_BLOB=$(git hash-object -t blob --stdin </dev/null) &&
CHANGED_BLOB=$(echo changed | git hash-object -t blob --stdin) &&
EMPTY_BLOB7=$(echo $EMPTY_BLOB | sed "s/\(.......\).*/\1/... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Erick Mattos
#
test_description='git commit --reset-author'
. ./test-lib.sh
author_header () {
git cat-file commit "$1" |
sed -n -e '/^$/q' -e '/^author /p'
}
message_body () {
git cat-file commit "$1" |
sed -e '1,/^$/d'
}
test_expect_success '-C option copies authorship and me... | Shell |
#!/bin/sh
test_description='CRLF conversion'
. ./test-lib.sh
has_cr() {
tr '\015' Q <"$1" | grep Q >/dev/null
}
test_expect_success setup '
git config core.autocrlf false &&
echo "one text" > .gitattributes &&
for w in Hello world how are you; do echo $w; done >one &&
for w in I am very very fine thank you;... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Johannes Sixt
#
test_description='git update-index on filesystem w/o symlinks test.
This tests that git update-index keeps the symbolic link property
even if a plain file is in the working tree if core.symlinks is false.'
. ./test-lib.sh
test_expect_success \
'preparation' '
git con... | Shell |
#!/bin/sh
test_description='git p4 relative chdir'
. ./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"
)
'
# P4 reads from P4CONFIG file to find its server params, if the
# environm... | Shell |
#!/bin/sh
test_description='test fetching of oddly-named refs'
. ./test-lib.sh
# afterwards we will have:
# HEAD - two
# refs/for/refs/heads/master - one
# refs/heads/master - three
test_expect_success 'setup repo with odd suffix ref' '
echo content >file &&
git add . &&
git commit -m one &&
git update-ref ref... | Shell |
#!/bin/sh
test_description='typechange rename detection'
. ./test-lib.sh
test_expect_success SYMLINKS setup '
rm -f foo bar &&
cat "$TEST_DIRECTORY"/../COPYING >foo &&
ln -s linklink bar &&
git add foo bar &&
git commit -a -m Initial &&
git tag one &&
rm -f foo bar &&
cat "$TEST_DIRECTORY"/../COPYING >bar ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Junio C Hamano
#
test_description='git mailinfo and git mailsplit test'
. ./test-lib.sh
test_expect_success 'split sample box' \
'git mailsplit -o. "$TEST_DIRECTORY"/t5100/sample.mbox >last &&
last=`cat last` &&
echo total is $last &&
test `cat last` = 16'
check_mailinfo () {
m... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Johan Herland
#
test_description='test git fast-import of notes objects'
. ./test-lib.sh
test_tick
cat >input <<INPUT_END
commit refs/heads/master
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
first commit
COMMIT
M 644 inline foo
data <<EOF
f... | Shell |
#!/bin/sh
test_description='test cloning a repository with detached HEAD'
. ./test-lib.sh
head_is_detached() {
git --git-dir=$1/.git rev-parse --verify HEAD &&
test_must_fail git --git-dir=$1/.git symbolic-ref HEAD
}
test_expect_success 'setup' '
echo one >file &&
git add file &&
git commit -m one &&
echo two ... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Amos Waterland
#
test_description='git rebase assorted tests
This test runs git rebase and checks that the author information is not lost
among other things.
'
. ./test-lib.sh
GIT_AUTHOR_NAME=author@name
GIT_AUTHOR_EMAIL=bogus@email@address
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL
te... | Shell |
#!/bin/sh
# Copyright (c) 2007 Eric Wong
test_description='git svn globbing refspecs'
. ./lib-git-svn.sh
cat > expect.end <<EOF
the end
hi
start a new branch
initial
EOF
test_expect_success 'test refspec globbing' '
mkdir -p trunk/src/a trunk/src/b trunk/doc &&
echo "hello world" > trunk/src/a/readme &&
echo "good... | Shell |
#!/bin/sh
test_description='merging when a directory was replaced with a symlink'
. ./test-lib.sh
test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink' '
mkdir -p a/b/c a/b-2/c &&
> a/b/c/d &&
> a/b-2/c/d &&
> a/x &&
git add -A &&
git commit -m base &&
git tag start &&
rm -rf a/b &&
... | Shell |
: included from t2016 and others
. ./test-lib.sh
set_state () {
echo "$3" > "$1" &&
git add "$1" &&
echo "$2" > "$1"
}
save_state () {
noslash="$(echo "$1" | tr / _)" &&
cat "$1" > _worktree_"$noslash" &&
git show :"$1" > _index_"$noslash"
}
set_and_save_state () {
set_state "$@" &&
save_state "$1"
}
verif... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Ben Jackson
#
test_description='git svn reset'
. ./lib-git-svn.sh
test_expect_success 'setup test repository' '
svn_cmd co "$svnrepo" s &&
(
cd s &&
mkdir vis &&
echo always visible > vis/vis.txt &&
svn_cmd add vis &&
svn_cmd commit -m "create visible files" &&
mkdir hid... | Shell |
#!/bin/sh
test_description='test cherry-picking an empty commit'
. ./test-lib.sh
test_expect_success setup '
echo first > file1 &&
git add file1 &&
test_tick &&
git commit -m "first" &&
git checkout -b empty-branch &&
test_tick &&
git commit --allow-empty -m "empty" &&
echo third >> file1 &&
git add file... | Shell |
#!/bin/sh
test_description='setup taking and sanitizing funny paths'
. ./test-lib.sh
test_expect_success setup '
mkdir -p a/b/c a/e &&
D=$(pwd) &&
>a/b/c/d &&
>a/e/f
'
test_expect_success 'git add (absolute)' '
git add "$D/a/b/c/d" &&
git ls-files >current &&
echo a/b/c/d >expect &&
test_cmp expect curre... | Shell |
#!/bin/sh
#
# Copyright (c) 2009 Giuseppe Bilotta
#
test_description='git-apply --ignore-whitespace.
'
. ./test-lib.sh
# This primes main.c file that indents without using HT at all.
# Various patches with HT and other spaces are attempted in the test.
cat > patch1.patch <<\EOF
diff --git a/main.c b/main.c
new file... | Shell |
#!/bin/sh
#
# Copyright (c) 2005 Jon Seymour
#
test_description='Tests git rev-list --bisect functionality'
. ./test-lib.sh
. "$TEST_DIRECTORY"/lib-t6000.sh # t6xxx specific functions
# usage: test_bisection max-diff bisect-option head ^prune...
#
# e.g. test_bisection 1 --bisect l1 ^l0
#
test_bisection_diff()
{
_ma... | Shell |
#!/bin/sh
#
# Copyright (c) 2008 Nicolas Pitre
#
test_description='resilience to pack corruptions with redundant objects'
. ./test-lib.sh
# Note: the test objects are created with knowledge of their pack encoding
# to ensure good code path coverage, and to facilitate direct alteration
# later on. The assumed charact... | Shell |
#!/bin/sh
#
# Copyright (c) 2007 Nicolas Pitre
#
test_description='pack index with 64-bit offsets and object CRC'
. ./test-lib.sh
test_expect_success \
'setup' \
'rm -rf .git &&
git init &&
git config pack.threads 1 &&
i=1 &&
while test $i -le 100
do
iii=`printf '%03i' $i`
... | Shell |
#!/bin/sh
#
# Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland
#
test_description='git rebase should detect patches integrated upstream
This test cherry-picks one local change of two into master branch, and
checks that git rebase succeeds with only the second patch in the
local branch.
'
. ./test-lib.... | Shell |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.