~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to merge-index.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <sys/types.h>
2
 
#include <sys/wait.h>
3
 
#include <signal.h>
4
 
 
5
1
#include "cache.h"
 
2
#include "run-command.h"
6
3
 
7
4
static const char *pgm;
8
 
static const char *arguments[8];
 
5
static const char *arguments[9];
9
6
static int one_shot, quiet;
10
7
static int err;
11
8
 
12
9
static void run_program(void)
13
10
{
14
 
        pid_t pid = fork();
15
 
        int status;
16
 
 
17
 
        if (pid < 0)
18
 
                die("unable to fork");
19
 
        if (!pid) {
20
 
                execlp(pgm, arguments[0],
21
 
                            arguments[1],
22
 
                            arguments[2],
23
 
                            arguments[3],
24
 
                            arguments[4],
25
 
                            arguments[5],
26
 
                            arguments[6],
27
 
                            arguments[7],
28
 
                            NULL);
29
 
                die("unable to execute '%s'", pgm);
30
 
        }
31
 
        if (waitpid(pid, &status, 0) < 0 || !WIFEXITED(status) || WEXITSTATUS(status)) {
 
11
        struct child_process child;
 
12
        memset(&child, 0, sizeof(child));
 
13
        child.argv = arguments;
 
14
        if (run_command(&child)) {
32
15
                if (one_shot) {
33
16
                        err++;
34
17
                } else {
53
36
        arguments[5] = "";
54
37
        arguments[6] = "";
55
38
        arguments[7] = "";
 
39
        arguments[8] = NULL;
56
40
        found = 0;
57
41
        do {
58
42
                static char hexbuf[4][60];
64
48
                        break;
65
49
                found++;
66
50
                strcpy(hexbuf[stage], sha1_to_hex(ce->sha1));
67
 
                sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode) & (~S_IFMT));
 
51
                sprintf(ownbuf[stage], "%o", ntohl(ce->ce_mode));
68
52
                arguments[stage] = hexbuf[stage];
69
53
                arguments[stage + 4] = ownbuf[stage];
70
54
        } while (++pos < active_nr);