Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  builtin-revert.c: release index lock when cherry-picking an empty commit
  document config --bool-or-int
  t1300: use test_must_fail as appropriate
  cleanup: add isascii()
  Documentation: fix badly indented paragraphs in "--bisect-all" description
  • Loading branch information
Junio C Hamano committed Mar 8, 2009
2 parents 113106e + 9a6682b commit 934f788
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 9 deletions.
4 changes: 4 additions & 0 deletions Documentation/git-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ See also <<FILES>>.
in the config file will cause the value to be multiplied
by 1024, 1048576, or 1073741824 prior to output.

--bool-or-int::
'git-config' will ensure that the output matches the format of
either --bool or --int, as described above.

-z::
--null::
For all options that output values and/or keys, always
Expand Down
4 changes: 2 additions & 2 deletions Documentation/rev-list-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,11 @@ This outputs all the commit objects between the included and excluded
commits, ordered by their distance to the included and excluded
commits. The farthest from them is displayed first. (This is the only
one displayed by `--bisect`.)

+
This is useful because it makes it easy to choose a good commit to
test when you want to avoid to test some of them for some reason (they
may not compile for example).

+
This option can be used along with `--bisect-vars`, in this case,
after all the sorted commit objects, there will be the same text as if
`--bisect-vars` had been used alone.
Expand Down
1 change: 1 addition & 0 deletions builtin-revert.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
(write_cache(index_fd, active_cache, active_nr) ||
commit_locked_index(&index_lock)))
die("%s: Unable to write new index file", me);
rollback_lock_file(&index_lock);

if (!clean) {
add_to_msg("\nConflicts:\n\n");
Expand Down
2 changes: 2 additions & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ static inline int has_extension(const char *filename, const char *ext)
}

/* Sane ctype - no locale, and works with signed chars */
#undef isascii
#undef isspace
#undef isdigit
#undef isalpha
Expand All @@ -332,6 +333,7 @@ extern unsigned char sane_ctype[256];
#define GIT_GLOB_SPECIAL 0x08
#define GIT_REGEX_SPECIAL 0x10
#define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
#define isascii(x) (((x) & ~0x7f) == 0)
#define isspace(x) sane_istest(x,GIT_SPACE)
#define isdigit(x) sane_istest(x,GIT_DIGIT)
#define isalpha(x) sane_istest(x,GIT_ALPHA)
Expand Down
3 changes: 1 addition & 2 deletions pretty.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ static int get_one_line(const char *msg)
/* High bit set, or ISO-2022-INT */
int non_ascii(int ch)
{
ch = (ch & 0xff);
return ((ch & 0x80) || (ch == 0x1b));
return !isascii(ch) || ch == '\033';
}

static int is_rfc2047_special(char ch)
Expand Down
10 changes: 5 additions & 5 deletions t/t1300-repo-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ test_expect_success 'get bool variable with empty value' \
'git config --bool emptyvalue.variable > output &&
cmp output expect'

git config > output 2>&1

test_expect_success 'no arguments, but no crash' \
"test $? = 129 && grep usage output"
test_expect_success 'no arguments, but no crash' '
test_must_fail git config >output 2>&1 &&
grep usage output
'

cat > .git/config << EOF
[a.b]
Expand Down Expand Up @@ -373,7 +373,7 @@ EOF
test_expect_success 'new variable inserts into proper section' 'cmp .git/config expect'

test_expect_success 'alternative GIT_CONFIG (non-existing file should fail)' \
'git config --file non-existing-config -l; test $? != 0'
'test_must_fail git config --file non-existing-config -l'

cat > other-config << EOF
[ein]
Expand Down
33 changes: 33 additions & 0 deletions t/t3505-cherry-pick-empty.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh

test_description='test cherry-picking an empty commit'

. ./test-lib.sh

test_expect_success setup '
echo first > file1 &&
git add file1 &&
test_tick &&
git commit -m "first" &&
git checkout -b empty-branch &&
test_tick &&
git commit --allow-empty -m "empty"
'

test_expect_code 1 'cherry-pick an empty commit' '
git checkout master &&
git cherry-pick empty-branch
'

test_expect_success 'index lockfile was removed' '
test ! -f .git/index.lock
'

test_done

0 comments on commit 934f788

Please sign in to comment.