diff options
-rwxr-xr-x | git-merge-resolve.sh | 6 | ||||
-rwxr-xr-x | git-merge.sh | 4 | ||||
-rw-r--r-- | gitMergeCommon.py | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/git-merge-resolve.sh b/git-merge-resolve.sh index e3b04a0e95..966e81ff7d 100755 --- a/git-merge-resolve.sh +++ b/git-merge-resolve.sh @@ -31,6 +31,12 @@ case "$remotes" in exit 2 ;; esac +# Give up if this is a baseless merge. +if test '' = "$bases" +then + exit 2 +fi + git-update-index --refresh 2>/dev/null git-read-tree -u -m $bases $head $remotes || exit 2 echo "Trying simple merge." diff --git a/git-merge.sh b/git-merge.sh index d12a2a93b1..3465041bc4 100755 --- a/git-merge.sh +++ b/git-merge.sh @@ -26,7 +26,7 @@ dropsave() { savestate() { # Stash away any local modifications. git-diff-index -r -z --name-only $head | - cpio -0 -o >"$GIR_DIR/MERGE_SAVE" + cpio -0 -o >"$GIT_DIR/MERGE_SAVE" } restorestate() { @@ -103,7 +103,7 @@ echo "$head" >"$GIT_DIR/ORIG_HEAD" case "$#,$common" in *,'') - die "Unable to find common commit between $head_arg and $*" + # No common ancestors found. We need a real merge. ;; 1,"$1") # If head can reach all the merge then we are up to date. diff --git a/gitMergeCommon.py b/gitMergeCommon.py index 7e8855c617..1b5bddd467 100644 --- a/gitMergeCommon.py +++ b/gitMergeCommon.py @@ -213,7 +213,7 @@ def buildGraph(heads): # Write the empty tree to the object database and return its SHA1 def writeEmptyTree(): - tmpIndex = os.environ['GIT_DIR'] + '/merge-tmp-index' + tmpIndex = os.environ.get('GIT_DIR', '.git') + '/merge-tmp-index' def delTmpIndex(): try: os.unlink(tmpIndex) |