Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Junio C Hamano committed Aug 13, 2010
2 parents 7980e41 + 452c6d5 commit 642f710
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
6 changes: 3 additions & 3 deletions base85.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
2 changes: 2 additions & 0 deletions builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down
4 changes: 2 additions & 2 deletions builtin/push.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand Down
8 changes: 4 additions & 4 deletions diffcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions http.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions t/t6050-replace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion t/t7003-filter-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit 642f710

Please sign in to comment.