[PATCH] mergetool: Don't error out in the merge case where the local file is deleted

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the file we are trying to merge resolve is in git-ls-files -u, then
skip the file existence test.  If the file isn't reported in
git-ls-files, then check to see if the file exists or not to give an
appropriate error message.

Signed-off-by: "Theodore Ts'o" <tytso@xxxxxxx>
---
 git-mergetool.sh |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/git-mergetool.sh b/git-mergetool.sh
index 3cc428c..9d959a9 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -111,14 +111,13 @@ resolve_deleted_merge () {
 merge_file () {
     path="$1"
 
-    if test ! -f "$path" ; then
-	echo "$path: file not found"
-	exit 1
-    fi
-
     f=`git-ls-files -u -- "$path"`
     if test -z "$f" ; then
-	echo "$path: file does not need merging"
+        if test ! -f "$path" ; then
+	    echo "$path: file not found"
+	else
+	    echo "$path: file does not need merging"
+	fi
 	exit 1
     fi
 
-- 
1.5.1.rc2.1.g8afe-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]