bug réparé avec le tmp_dir

This commit is contained in:
eleonore12345 2024-07-16 15:51:34 +02:00
parent 5f4b4d1d00
commit 327a91fb01

View File

@ -152,7 +152,7 @@ modification_check(){
else
echo "$FILE_TO_BE_DELETED has been deleted."
fi
run cd..
run cd ..
}
switching_branch_check(){
@ -236,11 +236,10 @@ modification_remote(){
}
undo_modification_remote(){
cd $TMP_CLONE_DIR
run cd $TMP_CLONE_DIR
run git revert --no-edit HEAD &> /dev/null
run git push &> /dev/null
cd ..
rm -rf $TMP_CLONE_DIR
}
modification_local(){
@ -282,7 +281,7 @@ test0 (){
if [ -d $REPO_NAME ]; then
rm -rf $REPO_NAME
fi
run ./git_update.sh -d $REPO_NAME $REMOTE
run ./git_update.sh -d $REPO_NAME $REMOTE &> /dev/null
#checks
cloning_check $REPO_NAME ${FILENAMES[@]}
history_check $REPO_NAME
@ -301,7 +300,7 @@ test1(){
if [ -d $REPO_NAME ]; then
run rm -rf $REPO_NAME
fi
run ./git_update.sh -d $REPO_NAME -r $TAG_NAME $REMOTE
run ./git_update.sh -d $REPO_NAME -r $TAG_NAME $REMOTE &> /dev/null
#checks
cloning_check $REPO_NAME ${FILENAMES_TAG[@]}
history_check $REPO_NAME
@ -322,7 +321,7 @@ test2(){
if [ -d $REPO_NAME ]; then
run rm -rf $REPO_NAME
fi
run ./git_update.sh -d $REPO_NAME -r $BRANCH_NAME $REMOTE
run ./git_update.sh -d $REPO_NAME -r $BRANCH_NAME $REMOTE &> /dev/null
#checks
cloning_check $REPO_NAME ${FILENAMES_BRANCH[@]} #we do not check for all files, especially not those specific to the branch.
history_check $REPO_NAME
@ -347,7 +346,7 @@ test3(){
make_temporary_existing_dir
#make git_update.sh clone in the existing dir
run cd $TMP_EXISTING_DIR
run ../git_update.sh -N $REMOTE
run ../git_update.sh -N $REMOTE &> /dev/null
run cd ..
#checks
cloning_check $TMP_EXISTING_DIR ${FILENAMES[@]}
@ -377,7 +376,7 @@ test4(){
modification_remote
#make git_update.sh update the repository
run cd $REPO_NAME
run ../git_update.sh $REMOTE
run ../git_update.sh $REMOTE &> /dev/null
run cd ..
#checks
modification_check $REPO_NAME
@ -408,7 +407,7 @@ test5(){
modification_remote
#make git_update.sh update the local repository
run cd $REPO_NAME
run ../git_update.sh $REMOTE
run ../git_update.sh $REMOTE &> /dev/null
run cd ..
#checks
run conflict_check $REPO_NAME
@ -434,7 +433,7 @@ test6(){
run git clone --recurse-submodules --shallow-submodules --depth 1 --config core.sshCommand="ssh" $REMOTE &> /dev/null
#call git update with another branch
cd $REPO_NAME
../git_update.sh -r $BRANCH_NAME $REMOTE
../git_update.sh -r $BRANCH_NAME $REMOTE &> /dev/null
cd ..
#checks
switching_branch_check $REPO_NAME
@ -458,7 +457,7 @@ test7(){
run git clone --recurse-submodules --shallow-submodules --depth 1 --config core.sshCommand="ssh" $REMOTE &> /dev/null
#call git_update.sh with a tag
cd $REPO_NAME
../git_update.sh -r $TAG_NAME $REMOTE
../git_update.sh -r $TAG_NAME $REMOTE &> /dev/null
run cd ..
#checks
switching_tag_check $REPO_NAME
@ -491,7 +490,7 @@ test8(){
changing_tag
#call git_update.sh again to go to the new position of the tag
run cd $REPO_NAME
../git_update.sh -r $TAG_NAME $REMOTE
../git_update.sh -r $TAG_NAME $REMOTE &> /dev/null
run cd ..
#put back the remote in its initial state
undo_changing_tag
@ -540,7 +539,6 @@ if [ "$ALL_TESTS" = "true" ]; then
test6
test7
test8
test9
rm -rf $TMP_CLONE_DIR
elif [ -n "$TEST_NUM" ]; then
#in order to only create the temporary clone once if we execute all tests
@ -570,7 +568,7 @@ elif [ -n "$TEST_NUM" ]; then
echo "Error: Invalid test number"
die;;
esac
if [ "$TEST_NUM" = 4 || "$TEST_NUM" = 5 || "$TEST_NUM" = 8 ];then
if [[ "$TEST_NUM" = 4 || "$TEST_NUM" = 5 || "$TEST_NUM" = 8 ]]; then
rm -rf $TMP_CLONE_DIR
fi
else