Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Fri, 26 Sep 2008 15:31:56 +0000 (08:31 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Fri, 26 Sep 2008 15:31:56 +0000 (08:31 -0700)
* maint:
Remove empty directories in recursive merge
Documentation: clarify the details of overriding LESS via core.pager

Conflicts:
builtin-merge-recursive.c

Documentation/config.txt
merge-recursive.c
t/t3030-merge-recursive.sh
index bea867df6005db3f9ea5aed4d303b4a77d94c1ca..1f805b2ecac4dad9e066b3392fdafc62caaa5b96 100644 (file)
@@ -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
index ac90fd9e2719a0084e45c195a446ee0571acb8e3..08917314fb18a2c5af71cf96c410d2c8363a2650 100644 (file)
@@ -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;
 }
index de0cdb1cf4e4dbb6395619bdd2f56c0b027fdea7..0de613dc53d85c01f6d122834e094503a2736507 100755 (executable)
@@ -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