aosp-merger: Run git diff with --no-ext-diff

* In case one is using an external diff program
  such as difftastic, this won't work as expected
* thread 'main' panicked at 'Hunk lines should be present in matched lines', /home/$USER/.cargo/registry/src/github.com-1ecc6299db9ec823/difftastic-0.37.0/src/display/hunks.rs:637:31
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  fatal: external diff died, stopping at core/Makefile

Change-Id: Ie455016fa24b6e00ea021088cc5fc1e4bca3bf94
This commit is contained in:
Chirayu Desai
2022-11-08 22:35:43 +05:30
parent fb2f8aa34f
commit 642284106c
2 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ chmod +x .git/hooks/prepare-commit-msg
if [ ! -z "${OLDTAG}" ]; then
# Was there any change upstream? Skip if not.
if [[ -z "$(git diff ${OLDTAG} ${NEWTAG})" ]]; then
if [[ -z "$(git diff --no-ext-diff ${OLDTAG} ${NEWTAG})" ]]; then
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
repo abandon "${STAGINGBRANCH}" .
exit 0
@@ -102,7 +102,7 @@ if [[ "${OPERATION}" == "merge" ]]; then
# Check if we've actually changed anything after the merge
# If we haven't, just abandon the branch
if [[ -z "$(git diff HEAD m/${os_branch})" && -z "$(git status --porcelain)" ]]; then
if [[ -z "$(git diff --no-ext-diff HEAD m/${os_branch})" && -z "$(git status --porcelain)" ]]; then
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
repo abandon "${STAGINGBRANCH}" .
exit 0

View File

@@ -80,7 +80,7 @@ chmod +x .git/hooks/prepare-commit-msg
if [ ! -z "${OLDTAG}" ]; then
# Was there any change upstream? Skip if not.
if [[ -z "$(git diff ${OLDTAG} ${NEWTAG})" ]]; then
if [[ -z "$(git diff --no-ext-diff ${OLDTAG} ${NEWTAG})" ]]; then
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
repo abandon "${STAGINGBRANCH}" .
exit 0
@@ -101,7 +101,7 @@ CONFLICT=""
echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
git merge --no-commit --log "${NEWTAG}"
if [[ -z "$(git diff HEAD)" ]]; then
if [[ -z "$(git diff --no-ext-diff HEAD)" ]]; then
echo "#### Skipping empty merge ####"
git reset --hard
else
@@ -119,7 +119,7 @@ for subtree in `find -mindepth 2 -type f -name .gitupstream | cut -d / -f 2- | s
git fetch -q --force --tags "$(cat ${gitupstream})" "${NEWTAG}"
git merge -X subtree="$subtree" --no-commit --log "${NEWTAG}"
if [[ -z "$(git diff HEAD)" ]]; then
if [[ -z "$(git diff --no-ext-diff HEAD)" ]]; then
echo "#### Skipping empty merge on ${subtree} ####"
git reset --hard
continue
@@ -138,7 +138,7 @@ done
# Check if we've actually changed anything after the merge
# If we haven't, just abandon the branch
if [[ -z "$(git diff HEAD m/${os_branch})" && -z "$(git status --porcelain)" ]]; then
if [[ -z "$(git diff --no-ext-diff HEAD m/${os_branch})" && -z "$(git status --porcelain)" ]]; then
echo -e "nochange\t\t${PROJECTPATH}" | tee -a "${MERGEDREPOS}"
repo abandon "${STAGINGBRANCH}" .
exit 0