diff options
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | 2006-06-10 16:13:41 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-06-10 11:14:00 -0700 |
commit | 52ba03cbb1c718093946f5254187082bd7b32845 (patch) | |
tree | 75bb33782f3527ad2617be04884d489cf9eba1df /get-tar-commit-id.c | |
parent | 5e3a620cd5f7baaf27198192a614271c6145ec3b (diff) | |
download | git-52ba03cbb1c718093946f5254187082bd7b32845.tar.gz |
Built-in git-get-tar-commit-id
By being an internal command git-get-commit-id can make use of
struct ustar_header and other stuff and stops wasting precious
disk space.
Note: I recycled one of the two "tar-tree" entries instead of
splitting that cleanup into a separate patch.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'get-tar-commit-id.c')
-rw-r--r-- | get-tar-commit-id.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/get-tar-commit-id.c b/get-tar-commit-id.c deleted file mode 100644 index 416629035c..0000000000 --- a/get-tar-commit-id.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2005 Rene Scharfe - */ -#include <stdio.h> -#include <string.h> -#include <unistd.h> - -#define HEADERSIZE 1024 - -int main(int argc, char **argv) -{ - char buffer[HEADERSIZE]; - ssize_t n; - - n = read(0, buffer, HEADERSIZE); - if (n < HEADERSIZE) { - fprintf(stderr, "read error\n"); - return 3; - } - if (buffer[156] != 'g') - return 1; - if (memcmp(&buffer[512], "52 comment=", 11)) - return 1; - n = write(1, &buffer[523], 41); - if (n < 41) { - fprintf(stderr, "write error\n"); - return 2; - } - return 0; -} |