From 9710a650a9d97a049b2e8e8437ad113f39f76929 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 29 May 2010 21:50:11 +0200 Subject: [PATCH] git am: ignore dirty submodules This fixes a rebase in the presence of dirty submodules. This is orthogonal to the application of patches changing submodules. Signed-off-by: Johannes Schindelin --- git-am.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-am.sh b/git-am.sh index 6b9f76a27d..ae9fc2346d 100755 --- a/git-am.sh +++ b/git-am.sh @@ -490,7 +490,8 @@ case "$resolved" in '') files=$(git ls-files) ;; ?*) - files=$(git diff-index --cached --name-only HEAD --) ;; + files=$(git diff-index --ignore-submodules --cached \ + --name-only HEAD --) ;; esac || exit if test "$files" then @@ -666,7 +667,8 @@ do case "$resolved$interactive" in tt) # This is used only for interactive view option. - git diff-index -p --cached HEAD -- >"$dotest/patch" + git diff-index --ignore-submodules -p --cached \ + HEAD -- >"$dotest/patch" ;; esac esac @@ -739,7 +741,7 @@ do # trust what the user has in the index file and the # working tree. resolved= - git diff-index --quiet --cached HEAD -- && { + git diff-index --ignore-submodules --quiet --cached HEAD -- && { echo "No changes - did you forget to use 'git add'?" echo "If there is nothing left to stage, chances are that something else" echo "already introduced the same changes; you might want to skip this patch." @@ -763,7 +765,8 @@ do then # Applying the patch to an earlier tree and merging the # result may have produced the same tree as ours. - git diff-index --quiet --cached HEAD -- && { + git diff-index --ignore-submodules --quiet --cached \ + HEAD -- && { say No changes -- Patch already applied. go_next continue -- 2.11.4.GIT