Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-17 02:05:02 +0300
committerJunio C Hamano <gitster@pobox.com>2010-02-17 02:05:02 +0300
commite7b3cea0f7589c57f7bb808330e32bdd7f901c95 (patch)
treef5612fd7df20b7d7273ddf44b30117e6eb1764a9
parentb599672316ae0e0cf827e5e2cd6d3bb403d7b8cd (diff)
parenteb0bcd0fbe34befe7648a398efc7f4156b07da48 (diff)
Merge branch 'maint-1.6.6' into maint
* maint-1.6.6: dwim_ref: fix dangling symref warning stash pop: remove 'apply' options during 'drop' invocation diff: make sure --output=/bad/path is caught Remove hyphen from "git-command" in two error messages
-rw-r--r--diff.c2
-rwxr-xr-xgit-stash.sh7
-rw-r--r--git.c2
-rw-r--r--help.c2
-rw-r--r--sha1_name.c3
-rwxr-xr-xt/t3903-stash.sh9
6 files changed, 19 insertions, 6 deletions
diff --git a/diff.c b/diff.c
index 381cc8d4fd..68def6caed 100644
--- a/diff.c
+++ b/diff.c
@@ -2893,6 +2893,8 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
;
else if (!prefixcmp(arg, "--output=")) {
options->file = fopen(arg + strlen("--output="), "w");
+ if (!options->file)
+ die_errno("Could not open '%s'", arg + strlen("--output="));
options->close_file = 1;
} else
return 0;
diff --git a/git-stash.sh b/git-stash.sh
index 3a0685f189..2d69196393 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -221,6 +221,7 @@ show_stash () {
}
apply_stash () {
+ applied_stash=
unstash_index=
while test $# != 0
@@ -242,6 +243,9 @@ apply_stash () {
if test $# = 0
then
have_stash || die 'Nothing to apply'
+ applied_stash="$ref_stash@{0}"
+ else
+ applied_stash="$*"
fi
# stash records the work tree, and is a merge between the
@@ -415,8 +419,7 @@ pop)
shift
if apply_stash "$@"
then
- test -z "$unstash_index" || shift
- drop_stash "$@"
+ drop_stash "$applied_stash"
fi
;;
branch)
diff --git a/git.c b/git.c
index 4c3028c098..c445d7bcc2 100644
--- a/git.c
+++ b/git.c
@@ -527,7 +527,7 @@ int main(int argc, const char **argv)
break;
if (was_alias) {
fprintf(stderr, "Expansion of alias '%s' failed; "
- "'%s' is not a git-command\n",
+ "'%s' is not a git command\n",
cmd, argv[0]);
exit(1);
}
diff --git a/help.c b/help.c
index 9da97d7462..7f4928e459 100644
--- a/help.c
+++ b/help.c
@@ -350,7 +350,7 @@ const char *help_unknown_cmd(const char *cmd)
return assumed;
}
- fprintf(stderr, "git: '%s' is not a git-command. See 'git --help'.\n", cmd);
+ fprintf(stderr, "git: '%s' is not a git command. See 'git --help'.\n", cmd);
if (SIMILAR_ENOUGH(best_similarity)) {
fprintf(stderr, "\nDid you mean %s?\n",
diff --git a/sha1_name.c b/sha1_name.c
index 77299257bf..43884c69b3 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -280,8 +280,7 @@ int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref)
*ref = xstrdup(r);
if (!warn_ambiguous_refs)
break;
- } else if ((flag & REF_ISSYMREF) &&
- (len != 4 || strcmp(str, "HEAD")))
+ } else if ((flag & REF_ISSYMREF) && strcmp(fullref, "HEAD"))
warning("ignoring dangling symref %s.", fullref);
}
free(last_branch);
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 5514f74b30..476e5ec038 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -194,6 +194,15 @@ test_expect_success 'pop -q is quiet' '
test ! -s output.out
'
+test_expect_success 'pop -q --index works and is quiet' '
+ echo foo > file &&
+ git add file &&
+ git stash save --quiet &&
+ git stash pop -q --index > output.out 2>&1 &&
+ test foo = "$(git show :file)" &&
+ test ! -s output.out
+'
+
test_expect_success 'drop -q is quiet' '
git stash &&
git stash drop -q > output.out 2>&1 &&