<commit_before>#!/bin/bash
#
# Automates installation of FOG.
# Arguments:
#  $1 The branch to checkout/pull from.
branch=$1
# writes error code to /root/result
#  Error 1 = Failed to call script properly.
#  Error 2 = Failed to reset git.
#  Error 3 = Failed to pull git.
#  Error 4 = Failed to checkout git.
#  Error 5 = Failed to change directory.
#  Error 6 = Installation failed.
#  All else "success".
usage() {
    local errCode=$1
    echo "Usage $0 <branch>"
	exit $errCode
}
result="/root/result"
output="/root/output"

[[ -z $branch ]] && printf "1" > $result
export PATH="$PATH:/usr/bin/core_perl"

cd /root/git/fogproject >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "5" > $result
[[ ! $stat -eq 0 ]] && exit $stat

git reset --hard >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "2" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git pull >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "3" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git checkout $branch >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "4" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git pull >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "2" > $result
[[ ! $stat -eq 0 ]] && exit $stat


cd bin >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "5" > $result
[[ ! $stat -eq 0 ]] && exit $stat


./installfog.sh -y > $output 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "6" > $result
[[ ! $stat -eq 0 ]] && exit $stat

# Here, we completed successfully.
printf "0" > $result


<commit_msg>Correct result code for 2nd pull<commit_after>#!/bin/bash
#
# Automates installation of FOG.
# Arguments:
#  $1 The branch to checkout/pull from.
branch=$1
# writes error code to /root/result
#  Error 1 = Failed to call script properly.
#  Error 2 = Failed to reset git.
#  Error 3 = Failed to pull git.
#  Error 4 = Failed to checkout git.
#  Error 5 = Failed to change directory.
#  Error 6 = Installation failed.
#  All else "success".
usage() {
    local errCode=$1
    echo "Usage $0 <branch>"
	exit $errCode
}
result="/root/result"
output="/root/output"

[[ -z $branch ]] && printf "1" > $result
export PATH="$PATH:/usr/bin/core_perl"

cd /root/git/fogproject >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "5" > $result
[[ ! $stat -eq 0 ]] && exit $stat

git reset --hard >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "2" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git pull >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "3" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git checkout $branch >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "4" > $result
[[ ! $stat -eq 0 ]] && exit $stat


git pull >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "3" > $result
[[ ! $stat -eq 0 ]] && exit $stat


cd bin >/dev/null 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "5" > $result
[[ ! $stat -eq 0 ]] && exit $stat


./installfog.sh -y > $output 2>&1
stat=$?
[[ ! $stat -eq 0 ]] && printf "6" > $result
[[ ! $stat -eq 0 ]] && exit $stat

# Here, we completed successfully.
printf "0" > $result



{'fraction_non_alphanumeric': 0.2090042720999014, 'fraction_numerical': 0.031219191587249426, 'mean_word_length': 3.015831134564644, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 51, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2636465', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1153, 'n_words': 395}