t-git-objects-not-present () {
# t-git-objects-not-present GITDIR|'' OBJID [...]
# specifying '' means the repo for package $p
- local gitdir="${1-$tmp/git/$p.git}"
+ local gitdir="${1-$dgitrepo}"
local obj
if ! [ -e "$gitdir" ]; then return; fi
for obj in "$@"; do
local outputfile="$tmp/show-refs.$whichoutput"
(set -e
exec >"$outputfile"
- if test -d $tmp/git/$p.git; then
- cd $tmp/git/$p.git
+ if test -d $dgitrepo; then
+ cd $dgitrepo
git show-ref |sort
fi)
}
t-select-package () {
p=$1
+ dgitrepo=$tmp/git/$p.git
}
t-git () {
}
t-git-dir-time-passes () {
- touch -d 'last year' $tmp/git/$p.git
+ touch -d 'last year' $dgitrepo
}
t-git-dir-check () {
- local gitdir=$tmp/git/$p.git
+ local gitdir=$dgitrepo
case "$1" in
enoent)
if test -e "$gitdir"; then fail "$gitdir exists"; fi
t-refs-notexist \
refs/heads/dgit/unstable \
refs/remotes/dgit/dgit/unstable
- (set -e; cd $tmp/git/$p.git
+ (set -e; cd $dgitrepo
t-refs-same \
refs/dgit/sid \
`t-v-tag`
t-dgit push --new
push_and_check () {
- git push $tmp/git/$p.git $1
+ git push $dgitrepo $1
- oldmaster=`cd $tmp/git/$p.git && t-git-get-ref refs/heads/master`
+ oldmaster=`cd $dgitrepo && t-git-get-ref refs/heads/master`
t-refs-same-start
git checkout master
git checkout -b divergent common-ancestor
git commit --allow-empty -m 'Has common ancestor'
-git push $tmp/git/$p.git HEAD:master
+git push $dgitrepo HEAD:master
push_and_check HEAD:master
prepare-replay --deliberately-fresh-repo
# simulate some other thing that we shouldn't delete
-git push $tmp/git/$p.git +master:refs/heads/for-testing
+git push $dgitrepo +master:refs/heads/for-testing
attempt-replay 'does not declare previously heads/for-testing'