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