SubmittingPatches: explain rationale for using --notes with format-patch
[gitweb.git] / shallow.c
index 4919baf7727bd25f35d76de5f40e27f6725d6881..cdd07751461e69291588dee801c3563644cb1107 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "lockfile.h"
 #include "commit.h"
 #include "tag.h"
 #include "pkt-line.h"
@@ -226,7 +227,6 @@ static void remove_temporary_shallow_on_signal(int signo)
 
 const char *setup_temporary_shallow(const struct sha1_array *extra)
 {
-       static int installed_handler;
        struct strbuf sb = STRBUF_INIT;
        int fd;
 
@@ -237,10 +237,8 @@ const char *setup_temporary_shallow(const struct sha1_array *extra)
                strbuf_addstr(&temporary_shallow, git_path("shallow_XXXXXX"));
                fd = xmkstemp(temporary_shallow.buf);
 
-               if (!installed_handler) {
-                       atexit(remove_temporary_shallow);
-                       sigchain_push_common(remove_temporary_shallow_on_signal);
-               }
+               atexit(remove_temporary_shallow);
+               sigchain_push_common(remove_temporary_shallow_on_signal);
 
                if (write_in_full(fd, sb.buf, sb.len) != sb.len)
                        die_errno("failed to write to %s",