Merge branch 'jc/finalize-temp-file'
authorJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:48:55 +0000 (14:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Aug 2015 21:48:55 +0000 (14:48 -0700)
Long overdue micro clean-up.

* jc/finalize-temp-file:
  sha1_file.c: rename move_temp_to_file() to finalize_object_file()

1  2 
builtin/index-pack.c
cache.h
fast-import.c
http.c
sha1_file.c

Simple merge
diff --cc cache.h
Simple merge
diff --cc fast-import.c
Simple merge
diff --cc http.c
Simple merge
diff --cc sha1_file.c
@@@ -3085,29 -2959,12 +3082,29 @@@ static int write_loose_object(const uns
                                tmp_file, strerror(errno));
        }
  
-       return move_temp_to_file(tmp_file, filename);
+       return finalize_object_file(tmp_file, filename);
  }
  
 -int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *returnsha1)
 +static int freshen_loose_object(const unsigned char *sha1)
 +{
 +      return check_and_freshen(sha1, 1);
 +}
 +
 +static int freshen_packed_object(const unsigned char *sha1)
 +{
 +      struct pack_entry e;
 +      if (!find_pack_entry(sha1, &e))
 +              return 0;
 +      if (e.p->freshened)
 +              return 1;
 +      if (!freshen_file(e.p->pack_name))
 +              return 0;
 +      e.p->freshened = 1;
 +      return 1;
 +}
 +
 +int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *sha1)
  {
 -      unsigned char sha1[20];
        char hdr[32];
        int hdrlen;