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

« back to all changes in this revision

Viewing changes to hash-object.c

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20070422133105-xg8fnm18r2cxcbg1
Tags: upstream-1.5.1.2
ImportĀ upstreamĀ versionĀ 1.5.1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#include "cache.h"
8
8
#include "blob.h"
9
9
 
10
 
static void hash_object(const char *path, const char *type, int write_object)
 
10
static void hash_object(const char *path, enum object_type type, int write_object)
11
11
{
12
12
        int fd;
13
13
        struct stat st;
15
15
        fd = open(path, O_RDONLY);
16
16
        if (fd < 0 ||
17
17
            fstat(fd, &st) < 0 ||
18
 
            index_fd(sha1, fd, &st, write_object, type))
 
18
            index_fd(sha1, fd, &st, write_object, type, path))
19
19
                die(write_object
20
20
                    ? "Unable to add %s to database"
21
21
                    : "Unable to hash %s", path);
73
73
                        if (0 <= prefix_length)
74
74
                                arg = prefix_filename(prefix, prefix_length,
75
75
                                                      arg);
76
 
                        hash_object(arg, type, write_object);
 
76
                        hash_object(arg, type_from_string(type), write_object);
77
77
                        no_more_flags = 1;
78
78
                }
79
79
        }