Re: [PATCH] Make git-reset delete empty directories

From: Shawn Pearce <spearce@spearce.org>
Date: 2006-02-18 03:01:12
Shawn Pearce <spearce@spearce.org> wrote:
> Junio C Hamano <junkio@cox.net> wrote:
> > I thought I said it would be a few-liner, but it appears I did
> > not send that message.

Actually its only a one line change if you accept Perl as Perl,
but not everyone likes having their loops do nothing in the loop
body whilest the condition does all of the work.

---
diff --git a/git-reset.sh b/git-reset.sh
index fe53fc8..e6471c0 100755
--- a/git-reset.sh
+++ b/git-reset.sh
@@ -88,6 +88,7 @@ case "$reset_type" in
                                # it is ok if this fails -- it may already
                                # have been culled by checkout-index.
                                unlink $_;
+                               1 while (s,/[^/]*$,, && rmdir $_);
                        }
                }
        ' $tmp-exists
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Sat Feb 18 03:02:13 2006

This archive was generated by hypermail 2.1.8 : 2006-02-18 03:02:25 EST