diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2008-09-26 08:31:56 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2008-09-26 08:31:56 -0700 |
commit | 15dc66abf02fa22a03d709725bcaeeec4b809834 (patch) | |
tree | ec812826aea20a20624ad6de5933941582634652 | |
parent | Cleanup remove_path (diff) | |
parent | Remove empty directories in recursive merge (diff) | |
download | tgif-15dc66abf02fa22a03d709725bcaeeec4b809834.tar.xz |
Merge branch 'maint'
* maint:
Remove empty directories in recursive merge
Documentation: clarify the details of overriding LESS via core.pager
Conflicts:
builtin-merge-recursive.c
-rw-r--r-- | Documentation/config.txt | 13 | ||||
-rw-r--r-- | merge-recursive.c | 4 | ||||
-rwxr-xr-x | t/t3030-merge-recursive.sh | 11 |
3 files changed, 23 insertions, 5 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index bea867df60..1f805b2eca 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -363,8 +363,17 @@ core.pager:: variable. Note that git sets the `LESS` environment variable to `FRSX` if it is unset when it runs the pager. One can change these settings by setting the - `LESS` variable to some other value or by giving the - `core.pager` option a value such as "`less -+FRSX`". + `LESS` variable to some other value. Alternately, + these settings can be overridden on a project or + global basis by setting the `core.pager` option. + Setting `core.pager` has no affect on the `LESS` + environment variable behaviour above, so if you want + to override git's default settings this way, you need + to be explicit. For example, to disable the S option + in a backward compatible manner, set `core.pager` + to "`less -+$LESS -FRX`". This will be passed to the + shell by git, which will translate the final command to + "`LESS=FRSX less -+FRSX -FRX`". core.whitespace:: A comma separated list of common whitespace problems to diff --git a/merge-recursive.c b/merge-recursive.c index ac90fd9e27..08917314fb 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -419,10 +419,8 @@ static int remove_file(struct merge_options *o, int clean, return -1; } if (update_working_directory) { - unlink(path); - if (errno != ENOENT || errno != EISDIR) + if (remove_path(path) && errno != ENOENT) return -1; - remove_path(path); } return 0; } diff --git a/t/t3030-merge-recursive.sh b/t/t3030-merge-recursive.sh index de0cdb1cf4..0de613dc53 100755 --- a/t/t3030-merge-recursive.sh +++ b/t/t3030-merge-recursive.sh @@ -535,4 +535,15 @@ test_expect_success 'reset and bind merge' ' ' +test_expect_success 'merge removes empty directories' ' + + git reset --hard master && + git checkout -b rm && + git rm d/e && + git commit -mremoved-d/e && + git checkout master && + git merge -s recursive rm && + test_must_fail test -d d +' + test_done |