]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-fetch--tool.c
Use 'fast-forward' all over the place
[thirdparty/git.git] / builtin-fetch--tool.c
index 469b07e240953aa21fd67eb2563e094a7f0f3d42..cd10dbcbc90ee155e05cffb49e88defcf35c5a59 100644 (file)
@@ -2,12 +2,13 @@
 #include "cache.h"
 #include "refs.h"
 #include "commit.h"
+#include "sigchain.h"
 
 static char *get_stdin(void)
 {
        struct strbuf buf = STRBUF_INIT;
        if (strbuf_read(&buf, 0, 1024) < 0) {
-               die("error reading standard input: %s", strerror(errno));
+               die_errno("error reading standard input");
        }
        return strbuf_detach(&buf, NULL);
 }
@@ -96,21 +97,21 @@ static int update_local_ref(const char *name,
        strcpy(newh, find_unique_abbrev(sha1_new, DEFAULT_ABBREV));
 
        if (in_merge_bases(current, &updated, 1)) {
-               fprintf(stderr, "* %s: fast forward to %s\n",
+               fprintf(stderr, "* %s: fast-forward to %s\n",
                        name, note);
                fprintf(stderr, "  old..new: %s..%s\n", oldh, newh);
-               return update_ref_env("fast forward", name, sha1_new, sha1_old);
+               return update_ref_env("fast-forward", name, sha1_new, sha1_old);
        }
        if (!force) {
                fprintf(stderr,
-                       "* %s: not updating to non-fast forward %s\n",
+                       "* %s: not updating to non-fast-forward %s\n",
                        name, note);
                fprintf(stderr,
                        "  old...new: %s...%s\n", oldh, newh);
                return 1;
        }
        fprintf(stderr,
-               "* %s: forcing update to non-fast forward %s\n",
+               "* %s: forcing update to non-fast-forward %s\n",
                name, note);
        fprintf(stderr, "  old...new: %s...%s\n", oldh, newh);
        return update_ref_env("forced-update", name, sha1_new, sha1_old);
@@ -186,7 +187,7 @@ static void remove_keep(void)
 static void remove_keep_on_signal(int signo)
 {
        remove_keep();
-       signal(SIGINT, SIG_DFL);
+       sigchain_pop(signo);
        raise(signo);
 }
 
@@ -245,7 +246,7 @@ static int fetch_native_store(FILE *fp,
        char buffer[1024];
        int err = 0;
 
-       signal(SIGINT, remove_keep_on_signal);
+       sigchain_push_common(remove_keep_on_signal);
        atexit(remove_keep);
 
        while (fgets(buffer, sizeof(buffer), stdin)) {