projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c333038
)
Add "has_sha1_pack()" function to query whether the object is available in a pack
author
Linus Torvalds
<torvalds@g5.osdl.org>
Sun, 3 Jul 2005 20:06:36 +0000
(13:06 -0700)
committer
Linus Torvalds
<torvalds@g5.osdl.org>
Sun, 3 Jul 2005 20:06:36 +0000
(13:06 -0700)
We'll want this for incremental packing.
cache.h
patch
|
blob
|
history
sha1_file.c
patch
|
blob
|
history
diff --git
a/cache.h
b/cache.h
index
1c0345b
..
bf589a8
100644
(file)
--- a/
cache.h
+++ b/
cache.h
@@
-176,6
+176,7
@@
extern int read_tree(void *buffer, unsigned long size, int stage);
extern int write_sha1_from_fd(const unsigned char *sha1, int fd);
+extern int has_sha1_pack(const unsigned char *sha1);
extern int has_sha1_file(const unsigned char *sha1);
/* Convert to/from hex/sha1 representation */
diff --git
a/sha1_file.c
b/sha1_file.c
index
b18e467
..
8f20e2f
100644
(file)
--- a/
sha1_file.c
+++ b/
sha1_file.c
@@
-1267,6
+1267,12
@@
int write_sha1_from_fd(const unsigned char *sha1, int fd)
return 0;
}
+int has_sha1_pack(const unsigned char *sha1)
+{
+ struct pack_entry e;
+ return find_pack_entry(sha1, &e);
+}
+
int has_sha1_file(const unsigned char *sha1)
{
struct stat st;