author | Linus Torvalds <torvalds@linux-foundation.org> | |
Sat, 26 May 2007 16:25:31 +0000 (09:25 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 27 May 2007 03:00:55 +0000 (20:00 -0700) | ||
commit | 99b5a79e1329468bee26ae3bd9070c47418279d0 | |
tree | f29c58779b93577898284d6e066eed244911f522 | tree | snapshot |
parent | c56ed464b0ba275d9f2e3598c61b391e98fc217b | commit | diff |
Make the pack-refs interfaces usable from outside
This just basically creates a "pack_refs()" function that could be used by
anybody. You pass it in the flags you want as a bitmask (PACK_REFS_ALL and
PACK_REFS_PRUNE), and it will do all the heavy lifting.
Of course, it's still static, and it's all in the builtin-pack-refs.c
file, so it's not actually visible to the outside, but the next step would
be to just move it all to a library file (probably refs.c) and expose it.
Then we could easily make "git gc" do this too.
While I did it, I also made it check the return value of the fflush and
fsync stage, to make sure that we don't overwrite the old packed-refs file
with something that got truncated due to write errors!
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This just basically creates a "pack_refs()" function that could be used by
anybody. You pass it in the flags you want as a bitmask (PACK_REFS_ALL and
PACK_REFS_PRUNE), and it will do all the heavy lifting.
Of course, it's still static, and it's all in the builtin-pack-refs.c
file, so it's not actually visible to the outside, but the next step would
be to just move it all to a library file (probably refs.c) and expose it.
Then we could easily make "git gc" do this too.
While I did it, I also made it check the return value of the fflush and
fsync stage, to make sure that we don't overwrite the old packed-refs file
with something that got truncated due to write errors!
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-pack-refs.c | diff | blob | history |