From 6e2a09d24b2634cdfec3395122cd4a07eb517b0d Mon Sep 17 00:00:00 2001 From: Nelson Elhage Date: Thu, 12 Aug 2010 10:18:12 -0400 Subject: index-pack: Don't follow replace refs. Without this, attempting to index a pack containing objects that have been replaced results in a fatal error that looks like: fatal: SHA1 COLLISION FOUND WITH ! Signed-off-by: Nelson Elhage Acked-by: Christian Couder Signed-off-by: Junio C Hamano diff --git a/builtin/index-pack.c b/builtin/index-pack.c index a89ae83..fad76bf 100644 --- a/builtin/index-pack.c +++ b/builtin/index-pack.c @@ -884,6 +884,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix) if (argc == 2 && !strcmp(argv[1], "-h")) usage(index_pack_usage); + read_replace_refs = 0; + /* * We wish to read the repository's config file if any, and * for that it is necessary to call setup_git_directory_gently(). diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh index 203ffdb..4185b7c 100755 --- a/t/t6050-replace.sh +++ b/t/t6050-replace.sh @@ -219,6 +219,12 @@ test_expect_success 'bisect and replacements' ' git bisect reset ' +test_expect_success 'index-pack and replacements' ' + git --no-replace-objects rev-list --objects HEAD | + git --no-replace-objects pack-objects test- && + git index-pack test-*.pack +' + # # test_done -- cgit v0.10.2-6-g49f6 From 0d1d6e50cf3401874b50b77aa1dc0e33357a1556 Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Thu, 12 Aug 2010 15:55:54 -0500 Subject: t/t7003: replace \t with literal tab in sed expression The sed utilities on IRIX and Solaris do not interpret the sequence '\t' to mean a tab character; they read a literal character 't'. So, use a literal tab instead. Signed-off-by: Brandon Casey Signed-off-by: Junio C Hamano diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh index fd7e3a1..2c55801 100755 --- a/t/t7003-filter-branch.sh +++ b/t/t7003-filter-branch.sh @@ -143,7 +143,7 @@ test_expect_success 'more setup' ' test_expect_success 'use index-filter to move into a subdirectory' ' git branch directorymoved && git filter-branch -f --index-filter \ - "git ls-files -s | sed \"s-\\t-&newsubdir/-\" | + "git ls-files -s | sed \"s- -&newsubdir/-\" | GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \ git update-index --index-info && mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved && -- cgit v0.10.2-6-g49f6 From 987460611ab08ebac83ead9a5ee316d3b3823e7f Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Thu, 12 Aug 2010 17:11:15 -0500 Subject: Standardize do { ... } while (0) style Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano diff --git a/base85.c b/base85.c index e459fee..781b575 100644 --- a/base85.c +++ b/base85.c @@ -7,9 +7,9 @@ #define say1(a,b) fprintf(stderr, a, b) #define say2(a,b,c) fprintf(stderr, a, b, c) #else -#define say(a) do {} while(0) -#define say1(a,b) do {} while(0) -#define say2(a,b,c) do {} while(0) +#define say(a) do { /* nothing */ } while (0) +#define say1(a,b) do { /* nothing */ } while (0) +#define say2(a,b,c) do { /* nothing */ } while (0) #endif static const char en85[] = { diff --git a/cache.h b/cache.h index c9fa3df..1e690d1 100644 --- a/cache.h +++ b/cache.h @@ -449,7 +449,7 @@ extern int init_db(const char *template_dir, unsigned int flags); alloc = alloc_nr(alloc); \ x = xrealloc((x), alloc * sizeof(*(x))); \ } \ - } while(0) + } while (0) /* Initialize and use the cache information */ extern int read_index(struct index_state *); diff --git a/diffcore.h b/diffcore.h index fed9b15..05ebc11 100644 --- a/diffcore.h +++ b/diffcore.h @@ -98,7 +98,7 @@ struct diff_queue_struct { (q)->queue = NULL; \ (q)->nr = (q)->alloc = 0; \ (q)->run = 0; \ - } while(0); + } while (0) extern struct diff_queue_struct diff_queued_diff; extern struct diff_filepair *diff_queue(struct diff_queue_struct *, @@ -118,9 +118,9 @@ void diff_debug_filespec(struct diff_filespec *, int, const char *); void diff_debug_filepair(const struct diff_filepair *, int); void diff_debug_queue(const char *, struct diff_queue_struct *); #else -#define diff_debug_filespec(a,b,c) do {} while(0) -#define diff_debug_filepair(a,b) do {} while(0) -#define diff_debug_queue(a,b) do {} while(0) +#define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0) +#define diff_debug_filepair(a,b) do { /* nothing */ } while (0) +#define diff_debug_queue(a,b) do { /* nothing */ } while (0) #endif extern int diffcore_count_changes(struct diff_filespec *src, diff --git a/http.h b/http.h index a0b5901..173f74c 100644 --- a/http.h +++ b/http.h @@ -23,10 +23,10 @@ #endif #if LIBCURL_VERSION_NUM < 0x070704 -#define curl_global_cleanup() do { /* nothing */ } while(0) +#define curl_global_cleanup() do { /* nothing */ } while (0) #endif #if LIBCURL_VERSION_NUM < 0x070800 -#define curl_global_init(a) do { /* nothing */ } while(0) +#define curl_global_init(a) do { /* nothing */ } while (0) #endif #if (LIBCURL_VERSION_NUM < 0x070c04) || (LIBCURL_VERSION_NUM == 0x071000) -- cgit v0.10.2-6-g49f6 From 452c6d506b1a6dcf24d4ceaa592afc39c1c1a60e Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Mon, 2 Aug 2010 15:42:44 +0200 Subject: push: mention "git pull" in error message for non-fast forwards The message remains fuzzy to include "git pull", "git pull --rebase" and others, but directs the user to the simplest solution in the vast majority of cases. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano diff --git a/builtin/push.c b/builtin/push.c index f4358b9..69bc2f2 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -130,8 +130,8 @@ static int push_with_options(struct transport *transport, int flags) if (nonfastforward && advice_push_nonfastforward) { fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n" - "Merge the remote changes before pushing again. See the 'Note about\n" - "fast-forwards' section of 'git push --help' for details.\n"); + "Merge the remote changes (e.g. 'git pull') before pushing again. See the\n" + "'Note about fast-forwards' section of 'git push --help' for details.\n"); } return 1; -- cgit v0.10.2-6-g49f6