summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2007-03-27 22:00:03 (GMT)
committerTheodore Ts'o <tytso@mit.edu>2007-03-29 16:22:48 (GMT)
commitce5b6d752bf4fdc72697ef85b3589983f52d7007 (patch)
treedfd384f1023e1b29335a8f3600ea545cdeefc2d8 /git-mergetool.sh
parent20fa04ea6bad985d74bd2c0180701f1c69272801 (diff)
downloadgit-ce5b6d752bf4fdc72697ef85b3589983f52d7007.zip
git-ce5b6d752bf4fdc72697ef85b3589983f52d7007.tar.gz
git-ce5b6d752bf4fdc72697ef85b3589983f52d7007.tar.bz2
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>
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-xgit-mergetool.sh11
1 files changed, 5 insertions, 6 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 3401823..fa301ad 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -109,14 +109,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