1 if [ -z "$REG_DIR" ]; then
2 echo "ERROR: You cannot run tests by hand" >&2
8 export PATH=$PWD/..:$PATH
11 export TOUCH_DATE="200701010000.00"
12 export GIT_AUTHOR_DATE="2007-01-01 00:00:00 UTC"
13 export GIT_COMMITTER_DATE="2007-01-01 00:00:00 UTC"
14 export GIT_AUTHOR_NAME="Author Name"
15 export GIT_AUTHOR_EMAIL="author@email"
16 export GIT_COMMITTER_NAME="Commiter Name"
17 export GIT_COMMITTER_EMAIL="commiter@email"
28 sed -e "s,$PWD,PATH,g" \
29 -e "s,$REG_DIR,REGDIR,g" \
30 -e "s,\.\.\. initial, initial,g" \
31 -e "s,^Already on branch,Already on,g"
36 sed -e 's:^\([0-9]*\) bytes (\([0-9]*\.[0-9]* .B\)) copied.*$:\1 bytes (\2) copied:'
43 "$@" 2>&1 | replace_path && return 0
47 # usage: shouldfail <cmd>..
62 find .git/refs/patches -type f -exec dump_ref {} \; 2> /dev/null || true
63 find .git/refs/patches -type d -exec dump_reg {} \; 2> /dev/null || true
64 find .git/patches -exec dump_reg {} \;
68 function setup_git_repo
70 # set up the repo so we have something interesting to run guilt on
73 git commit -s -m "initial" 2> /dev/null > /dev/null
74 # the commit should be d4850419ccc1146c7169f500725ce504b9774ed0
77 function setup_guilt_repo
79 mkdir -p .git/patches/master
81 # patch to modify a file
82 cp "$REG_DIR/data/modify.patch" .git/patches/master/modify
84 # patch to add a new file
85 cp "$REG_DIR/data/add.patch" .git/patches/master/add
87 # patch to remove an existing file
88 cp "$REG_DIR/data/remove.patch" .git/patches/master/remove
90 # patch to change a mode
91 cp "$REG_DIR/data/mode.patch" .git/patches/master/mode
93 # the series file of all the things
94 cp "$REG_DIR/data/series" .git/patches/master/series
97 touch .git/patches/master/status
100 touch .git/patches/master/status
102 touch -a -m -t "$TOUCH_DATE" .git/patches/master/modify
103 touch -a -m -t "$TOUCH_DATE" .git/patches/master/add
104 touch -a -m -t "$TOUCH_DATE" .git/patches/master/remove
105 touch -a -m -t "$TOUCH_DATE" .git/patches/master/mode
108 function reset_git_repo
112 git reset --hard d4850419ccc1146c7169f500725ce504b9774ed0