X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=merge-index.c;h=7027d7865971646f178690a150246d9bc4d674c0;hb=77b50ab009deab7f8eb703843a71ac7253b977c8;hp=0498a6f45e53947e356c6a390869d3f8194f05b7;hpb=6a0dbb8a5c41770c2280de15c3202970c6515ccc;p=git.git diff --git a/merge-index.c b/merge-index.c index 0498a6f45..7027d7865 100644 --- a/merge-index.c +++ b/merge-index.c @@ -1,17 +1,14 @@ -#include -#include -#include - #include "cache.h" -static const char *pgm = NULL; +static const char *pgm; static const char *arguments[8]; static int one_shot, quiet; static int err; static void run_program(void) { - int pid = fork(), status; + pid_t pid = fork(); + int status; if (pid < 0) die("unable to fork"); @@ -63,7 +60,7 @@ static int merge_entry(int pos, const char *path) break; found++; strcpy(hexbuf[stage], sha1_to_hex(ce->sha1)); - sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT)); + sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode)); arguments[stage] = hexbuf[stage]; arguments[stage + 4] = ownbuf[stage]; } while (++pos < active_nr);