aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-02 23:59:50 -0800
committerJunio C Hamano <gitster@pobox.com>2008-03-02 23:59:50 -0800
commit6b48990354b6380665565f21c3f89d2f7109c459 (patch)
treec3eefde8d65ef12c7af7a68ba045cc55f98cd2b8
parent34cd62eb91600109378c8121c1fecd924a9af177 (diff)
parentd3df4271b900c9bf529cf495afeb77fbbf621221 (diff)
downloadgit-6b48990354b6380665565f21c3f89d2f7109c459.tar.gz
git-6b48990354b6380665565f21c3f89d2f7109c459.tar.xz
Merge branch 'maint'
* 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
-rw-r--r--Documentation/RelNotes-1.5.4.4.txt22
-rw-r--r--builtin-revert.c20
-rwxr-xr-xgit-submodule.sh2
-rw-r--r--receive-pack.c2
-rwxr-xr-xt/t3501-revert-cherry-pick.sh9
5 files changed, 49 insertions, 6 deletions
diff --git a/Documentation/RelNotes-1.5.4.4.txt b/Documentation/RelNotes-1.5.4.4.txt
index 5bfdb3537..5635977c9 100644
--- a/Documentation/RelNotes-1.5.4.4.txt
+++ b/Documentation/RelNotes-1.5.4.4.txt
@@ -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
diff --git a/builtin-revert.c b/builtin-revert.c
index b6dee6a56..607a2f033 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -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();
}
diff --git a/git-submodule.sh b/git-submodule.sh
index a6aaf40b0..67d3224c8 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -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;
diff --git a/receive-pack.c b/receive-pack.c
index 0ca2a80bf..de7e18c49 100644
--- a/receive-pack.c
+++ b/receive-pack.c
@@ -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);
diff --git a/t/t3501-revert-cherry-pick.sh b/t/t3501-revert-cherry-pick.sh
index 2dbe04fb2..6da212825 100755
--- a/t/t3501-revert-cherry-pick.sh
+++ b/t/t3501-revert-cherry-pick.sh
@@ -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