#!/bin/sh # # Copyright (c) 2009 Robert Zeh global test_description := ''git svn creates empty directories, calls git gc, makes sure they are still empty'' source ./lib-git-svn.sh test_expect_success 'initialize repo' ' for i in a b c d d/e d/e/f "weird file name" do svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" done ' test_expect_success 'clone' 'git svn clone "$svnrepo" cloned' test_expect_success 'git svn gc runs' ' ( cd cloned && git svn gc ) ' test_expect_success 'git svn mkdirs recreates empty directories after git svn gc' ' ( cd cloned && rm -r * && git svn mkdirs && for i in a b c d d/e d/e/f "weird file name" do if ! test -d "$i" then echo >&2 "$i does not exist" exit 1 fi done ) ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: { (SQ < "git svn creates empty directories, calls git gc, makes sure they are still empty" > ) } spids: [10] ) ] spids: [10] ) (C {(.)} {(./lib-git-svn.sh)}) (C {(test_expect_success)} {(SQ <"initialize repo">)} { (SQ <"\n"> <"\tfor i in a b c d d/e d/e/f \"weird file name\"\n"> <"\tdo\n"> <"\t\tsvn_cmd mkdir -m \"mkdir $i\" \"$svnrepo\"/\"$i\"\n"> <"\tdone\n"> ) } ) (C {(test_expect_success)} {(SQ )} {(SQ <"git svn clone \"$svnrepo\" cloned">)}) (C {(test_expect_success)} {(SQ <"git svn gc runs">)} {(SQ <"\n"> <"\t(\n"> <"\t\tcd cloned &&\n"> <"\t\tgit svn gc\n"> <"\t)\n">)} ) (C {(test_expect_success)} {(SQ <"git svn mkdirs recreates empty directories after git svn gc">)} { (SQ <"\n"> <"\t(\n"> <"\t\tcd cloned &&\n"> <"\t\trm -r * &&\n"> <"\t\tgit svn mkdirs &&\n"> <"\t\tfor i in a b c d d/e d/e/f \"weird file name\"\n"> <"\t\tdo\n"> <"\t\t\tif ! test -d \"$i\"\n"> <"\t\t\tthen\n"> <"\t\t\t\techo >&2 \"$i does not exist\"\n"> <"\t\t\t\texit 1\n"> <"\t\t\tfi\n"> <"\t\tdone\n"> <"\t)\n"> ) } ) (C {(test_done)}) ] )