Skip to content

Commit

Permalink
Exit within subshell (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
benedikt-schesch authored Sep 16, 2024
1 parent 32ec0cf commit f8b0b97
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/git_hires_merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ branch2=$3
# Print the current PATH
echo "PATH: $PATH"

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir from $(pwd)"; exit 2; }

git checkout "$branch1" --force

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/gitmerge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ git_strategy=$4

## Perform merge

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }

git checkout "$branch1" --force
git config --local merge.conflictstyle diff3
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/gitmerge_resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ status=$?

if [ "$status" -ne 0 ]; then
echo "Removing filenames from conflict markers."
cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }
readarray -t files < <(grep -l -r '^\(<<<<<<<\||||||||\|>>>>>>>\) .merge_file_')
for file in "${files[@]}" ; do
echo "Removing filenames from conflict markers in $file"
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/intellimerge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ echo "Temp dir: $temp_out_dir"
clone_dir_absolutepath=$(realpath "$clone_dir")

# run intellimerge
cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }

java -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -Djava.io.tmpdir="$temp_intellimerge_dir" -jar "$intellimerge_absolutepath" -r "$clone_dir_absolutepath" -b "$branch1" "$branch2" -o $temp_out_dir

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/merge_git_then_plumelib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plumelib_strategy=$5 #"--only-adjacent"

echo "$0: Merging $branch1 and $branch2 with git_strategy=$git_strategy and plumelib_strategy=$plumelib_strategy"

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }

git checkout "$branch1" --force
git config --local merge.conflictstyle diff3
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/merge_script_then_plumelib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ plumelib_strategy=$5 #"--only-adjacent"

echo "$0: Merging $branch1 and $branch2 with merge_script=$merge_script and plumelib_strategy=$plumelib_strategy"

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }

git checkout "$branch1" --force
git config --local merge.conflictstyle diff3
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/merge_tools/spork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ clone_dir=$1
branch1=$2
branch2=$3

cd "$clone_dir" || (echo "$0: cannot cd to $clone_dir" ; exit 2)
cd "$clone_dir" || { echo "$0: cannot cd to $clone_dir"; exit 2; }

# set up spork driver
git config --local merge.spork.name "spork"
Expand Down

0 comments on commit f8b0b97

Please sign in to comment.