#!/bin/bash # Copyright 2021 Ian Jackson and contributors # SPDX-License-Identifier: GPL-3.0-or-later # There is NO WARRANTY. set -e . ${0%/*}/../common.sh new=argument/blank.rs.new script=" x () { echo \"== \$*\"; \"\$@\"; } rm -f $new perl -i~ -pe '' macros/macros.rs RUST_PARTIAL_BORROW_EXPAND_DEBUG=\">\$PWD/$new\" \ x cargo build --bin argument-input " case "$CARGO" in *nailing*) $CARGO --linkfarm=git -sbuild --- bash -ec " { $script } >&2 cat $new " >"$new" ;; *) eval "$script" ;; esac cd argument rm -f argument.rs.old blank.rs.old git cat-file blob HEAD:argument/argument.rs >argument.rs.old git cat-file blob HEAD:argument/blank.rs >blank.rs.old diff3 -m \ blank.rs.new \ blank.rs.old \ argument.rs.old \ >argument.rs.new \ || test $? = 1 cp argument.rs.new argument.rs cp blank.rs.new blank.rs echo 'Merge complete (there may be conflicts etc.)'