summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-10-17 19:23:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-10-18 23:10:57 (GMT)
commit55846b9abd128185388418e025651cfd6a299a0e (patch)
treeca0457d27b1e5d57c8c5c3a5f47c50a355c69f81 /t
parent9e5f5d4cfea5bb7706f1f8bb07795d52d37a59fe (diff)
downloadgit-55846b9abd128185388418e025651cfd6a299a0e.zip
git-55846b9abd128185388418e025651cfd6a299a0e.tar.gz
git-55846b9abd128185388418e025651cfd6a299a0e.tar.bz2
merge-file: correctly find files when called in subdir
Since b541248 (merge.conflictstyle: choose between "merge" and "diff3 -m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(), thus cd'ing around to find any possible config files to use. This broke merge-file when it is called from within a subdirectory of a repository, and the arguments are all relative paths. Fix by prepending the prefix, as passed down from the main git setup code, if there is any. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t6023-merge-file.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t6023-merge-file.sh b/t/t6023-merge-file.sh
index d486d73..d9f3439 100755
--- a/t/t6023-merge-file.sh
+++ b/t/t6023-merge-file.sh
@@ -64,6 +64,14 @@ cp new1.txt test.txt
test_expect_success "merge without conflict" \
"git merge-file test.txt orig.txt new2.txt"
+test_expect_success 'works in subdirectory' '
+ mkdir dir &&
+ cp new1.txt dir/a.txt &&
+ cp orig.txt dir/o.txt &&
+ cp new2.txt dir/b.txt &&
+ ( cd dir && git merge-file a.txt o.txt b.txt )
+'
+
cp new1.txt test.txt
test_expect_success "merge without conflict (--quiet)" \
"git merge-file --quiet test.txt orig.txt new2.txt"