* maint:
  Update draft release notes for 1.5.4.4
  revert: actually check for a dirty index
  tests: introduce test_must_fail
  git-submodule: Fix typo 'url' which should be '$url'
  receive-pack: Initialize PATH to include exec-dir.

Conflicts:

	builtin-revert.c
This commit is contained in:
Junio C Hamano 2008-03-02 23:59:50 -08:00
Родитель 34cd62eb91 d3df4271b9
Коммит 6b48990354
5 изменённых файлов: 49 добавлений и 6 удалений

Просмотреть файл

@ -4,6 +4,10 @@ GIT v1.5.4.4 Release Notes
Fixes since v1.5.4.3
--------------------
* Building and installing with an overtight umask such as 077 made
installed templates unreadable by others, while the rest of the install
are done in a way that is friendly to umask 022.
* "git cvsexportcommit -w $cvsdir" misbehaved when GIT_DIR is set to a
relative directory.
@ -17,10 +21,26 @@ Fixes since v1.5.4.3
* "git send-email" in 1.5.4.3 issued a bogus empty In-Reply-To: header.
* "git bisect" showed mysterious "won't bisect on seeked tree" error message.
This was leftover from Cogito days to prevent "bisect" starting from a
cg-seeked state. We still keep the Cogito safety, but running "git bisect
start" when another bisect was in effect will clean up and start over.
* "git push" with an explicit PATH to receive-pack did not quite work if
receive-pack was not on usual PATH. We earlier fixed the same issue
with "git fetch" and upload-pack, but somehow forgot to do so in the
other direction.
* git-gui's info dialog was not displayed correctly when the user tries
to commit nothing (i.e. without staging anything).
* "git revert" did not properly fail when attempting to run with a
dirty index.
Also included are a handful documentation updates.
---
exec >/var/tmp/1
echo O=$(git describe maint)
O=v1.5.4.3
O=v1.5.4.3-32-g0f2d447
git shortlog --no-merges $O..maint

Просмотреть файл

@ -9,6 +9,8 @@
#include "utf8.h"
#include "parse-options.h"
#include "cache-tree.h"
#include "diff.h"
#include "revision.h"
/*
* This implements the builtins revert and cherry-pick.
@ -246,6 +248,17 @@ static char *help_msg(const unsigned char *sha1)
return helpbuf;
}
static int index_is_dirty(void)
{
struct rev_info rev;
init_revisions(&rev, NULL);
setup_revisions(0, NULL, &rev, "HEAD");
DIFF_OPT_SET(&rev.diffopt, QUIET);
DIFF_OPT_SET(&rev.diffopt, EXIT_WITH_STATUS);
run_diff_index(&rev, 1);
return !!DIFF_OPT_TST(&rev.diffopt, HAS_CHANGES);
}
static int revert_or_cherry_pick(int argc, const char **argv)
{
unsigned char head[20];
@ -274,12 +287,11 @@ static int revert_or_cherry_pick(int argc, const char **argv)
if (write_cache_as_tree(head, 0, NULL))
die ("Your index file is unmerged.");
} else {
struct wt_status s;
if (get_sha1("HEAD", head))
die ("You do not have a valid HEAD");
wt_status_prepare(&s);
if (s.commitable)
if (read_cache() < 0)
die("could not read the index");
if (index_is_dirty())
die ("Dirty index: cannot %s", me);
discard_cache();
}

Просмотреть файл

@ -362,7 +362,7 @@ cmd_status()
do
name=$(module_name "$path") || exit
url=$(git config submodule."$name".url)
if test -z "url" || ! test -d "$path"/.git
if test -z "$url" || ! test -d "$path"/.git
then
say "-$sha1 $path"
continue;

Просмотреть файл

@ -481,6 +481,8 @@ int main(int argc, char **argv)
if (!dir)
usage(receive_pack_usage);
setup_path(NULL);
if (!enter_repo(dir, 0))
die("'%s': unable to chdir or not a git archive", dir);

Просмотреть файл

@ -59,4 +59,13 @@ test_expect_success 'revert after renaming branch' '
'
test_expect_success 'revert forbidden on dirty working tree' '
echo content >extra_file &&
git add extra_file &&
test_must_fail git revert HEAD 2>errors &&
grep "Dirty index" errors
'
test_done