Re: [PATCH v2] merge-file: correctly open files when in a subdir

2015-02-11 Thread Junio C Hamano
Aleksander Boruch-Gruszecki aleksander.boruchgrusze...@gmail.com writes: @@ -72,6 +72,12 @@ test_expect_success 'works in subdirectory' ' ( cd dir git merge-file a.txt o.txt b.txt ) ' +mkdir -p dir/deep +cp new1.txt orig.txt new2.txt dir/deep +test_expect_success 'accounts for

Re: [PATCH v2] merge-file: correctly open files when in a subdir

2015-02-11 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Thanks, that makes sense and it also makes sense that checking the resulting content in dir/a.txt would make sense. Then we many not need to add a new dir/deep/* test---after all they are checking the same thing. Here is what I have right now, queued

Re: [PATCH v2] merge-file: correctly open files when in a subdir

2015-02-11 Thread Aleksander Boruch-Gruszecki
Here is what I have right now, queued somewhere in 'pu', after fixing it up a bit. That's awesome! Thanks for your help :) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v2] merge-file: correctly open files when in a subdir

2015-02-11 Thread Aleksander Boruch-Gruszecki
const char *filename = argv[0]; -FILE *f = to_stdout ? stdout : fopen(filename, wb); +const char *fpath = prefix_filename(prefix, prefixlen, argv[0]); +FILE *f = to_stdout ? stdout : fopen(fpath, wb); if (!f) ret = error(Could not open

Re: [PATCH v2] merge-file: correctly open files when in a subdir

2015-02-10 Thread Junio C Hamano
Aleksander Boruch-Gruszecki aleksander.boruchgrusze...@gmail.com writes: run_setup_gently() is called before merge-file. This may result in changing current working directory, which wasn't taken into account when opening a file for writing. Fix by prepending the passed prefix. Previous var

[PATCH v2] merge-file: correctly open files when in a subdir

2015-02-10 Thread Aleksander Boruch-Gruszecki
run_setup_gently() is called before merge-file. This may result in changing current working directory, which wasn't taken into account when opening a file for writing. Fix by prepending the passed prefix. Previous var is left so that error messages keep refering to the file from the user's