Merge branch 'maint'

* maint:
  push: mention "git pull" in error message for non-fast forwards
  Standardize do { ... } while (0) style
  t/t7003: replace \t with literal tab in sed expression
  index-pack: Don't follow replace refs.
This commit is contained in:
Junio C Hamano 2010-08-12 18:07:09 -07:00
commit 642f7108f6
8 changed files with 21 additions and 13 deletions

View File

@ -7,9 +7,9 @@
#define say1(a,b) fprintf(stderr, a, b) #define say1(a,b) fprintf(stderr, a, b)
#define say2(a,b,c) fprintf(stderr, a, b, c) #define say2(a,b,c) fprintf(stderr, a, b, c)
#else #else
#define say(a) do {} while(0) #define say(a) do { /* nothing */ } while (0)
#define say1(a,b) do {} while(0) #define say1(a,b) do { /* nothing */ } while (0)
#define say2(a,b,c) do {} while(0) #define say2(a,b,c) do { /* nothing */ } while (0)
#endif #endif
static const char en85[] = { static const char en85[] = {

View File

@ -884,6 +884,8 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
if (argc == 2 && !strcmp(argv[1], "-h")) if (argc == 2 && !strcmp(argv[1], "-h"))
usage(index_pack_usage); usage(index_pack_usage);
read_replace_refs = 0;
/* /*
* We wish to read the repository's config file if any, and * We wish to read the repository's config file if any, and
* for that it is necessary to call setup_git_directory_gently(). * for that it is necessary to call setup_git_directory_gently().

View File

@ -130,8 +130,8 @@ static int push_with_options(struct transport *transport, int flags)
if (nonfastforward && advice_push_nonfastforward) { if (nonfastforward && advice_push_nonfastforward) {
fprintf(stderr, "To prevent you from losing history, non-fast-forward updates were rejected\n" 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" "Merge the remote changes (e.g. 'git pull') before pushing again. See the\n"
"fast-forwards' section of 'git push --help' for details.\n"); "'Note about fast-forwards' section of 'git push --help' for details.\n");
} }
return 1; return 1;

View File

@ -98,7 +98,7 @@ struct diff_queue_struct {
(q)->queue = NULL; \ (q)->queue = NULL; \
(q)->nr = (q)->alloc = 0; \ (q)->nr = (q)->alloc = 0; \
(q)->run = 0; \ (q)->run = 0; \
} while(0); } while (0)
extern struct diff_queue_struct diff_queued_diff; extern struct diff_queue_struct diff_queued_diff;
extern struct diff_filepair *diff_queue(struct diff_queue_struct *, 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_filepair(const struct diff_filepair *, int);
void diff_debug_queue(const char *, struct diff_queue_struct *); void diff_debug_queue(const char *, struct diff_queue_struct *);
#else #else
#define diff_debug_filespec(a,b,c) do {} while(0) #define diff_debug_filespec(a,b,c) do { /* nothing */ } while (0)
#define diff_debug_filepair(a,b) do {} while(0) #define diff_debug_filepair(a,b) do { /* nothing */ } while (0)
#define diff_debug_queue(a,b) do {} while(0) #define diff_debug_queue(a,b) do { /* nothing */ } while (0)
#endif #endif
extern int diffcore_count_changes(struct diff_filespec *src, extern int diffcore_count_changes(struct diff_filespec *src,

View File

@ -219,6 +219,12 @@ test_expect_success 'bisect and replacements' '
git bisect reset 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 test_done

View File

@ -143,7 +143,7 @@ test_expect_success 'more setup' '
test_expect_success 'use index-filter to move into a subdirectory' ' test_expect_success 'use index-filter to move into a subdirectory' '
git branch directorymoved && git branch directorymoved &&
git filter-branch -f --index-filter \ 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_INDEX_FILE=\$GIT_INDEX_FILE.new \
git update-index --index-info && git update-index --index-info &&
mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved && mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&