mergetool: Don't error out in the merge case where the local file is deleted
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@mit.edu>
Theodore Ts'o committed
Mar 27, 2007 at 18:00 UTC
ce5b6d752bf4fdc72697ef85b3589983f52d7007
1 file changed
+5
-6
git-mergetool.sh
+5
-6
@@ -109,14 +109,13 @@ resolve_deleted_merge () {
109
merge_file () {
110
path="$1"
111
112
- if test ! -f "$path" ; then
113
- echo "$path: file not found"
114
- exit 1
115
- fi
116
-
112
f=`git-ls-files -u -- "$path"`
113
if test -z "$f" ; then
119
- echo "$path: file does not need merging"
114
+ if test ! -f "$path" ; then
115
+ echo "$path: file not found"
116
+ else
117
+ echo "$path: file does not need merging"
118
+ fi
119
exit 1
120
fi
121