diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-20 16:13:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-20 16:13:13 -0800 |
commit | 23f12912d1b6c608a7418d242e257b7239861f61 (patch) | |
tree | 1fc8a793688652e08f7b0a4b11b9a5bc2f3f9733 | |
parent | f27e55864317611385be4d33b3c53ca787379df9 (diff) | |
parent | 0ca15e7217285edaa6c93b53165e1250d25f030b (diff) | |
download | git-23f12912d1b6c608a7418d242e257b7239861f61.tar.gz |
Merge branch 'maint'
* maint:
Clarified the meaning of git-add -u in the documentation
git-clone.sh: properly configure remote even if remote's head is dangling
Documentation/git-stash: document options for git stash list
send-email: squelch warning due to comparing undefined $_ to ""
-rw-r--r-- | Documentation/git-add.txt | 4 | ||||
-rw-r--r-- | Documentation/git-stash.txt | 5 | ||||
-rwxr-xr-x | git-clone.sh | 18 | ||||
-rwxr-xr-x | git-send-email.perl | 2 | ||||
-rwxr-xr-x | t/t5701-clone-local.sh | 8 |
5 files changed, 28 insertions, 9 deletions
diff --git a/Documentation/git-add.txt b/Documentation/git-add.txt index 9d2ac865d2..47799097ce 100644 --- a/Documentation/git-add.txt +++ b/Documentation/git-add.txt @@ -74,8 +74,8 @@ OPTIONS Update only files that git already knows about. This is similar to what "git commit -a" does in preparation for making a commit, except that the update is limited to paths specified on the - command line. If no paths are specified, all tracked files are - updated. + command line. If no paths are specified, all tracked files in the + current directory and its subdirectories are updated. \--refresh:: Don't add the file(s), but only refresh their stat() diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt index cd0dc1bd9d..48e6f5a3f7 100644 --- a/Documentation/git-stash.txt +++ b/Documentation/git-stash.txt @@ -43,7 +43,7 @@ save [<message>]:: subcommand is given. The <message> part is optional and gives the description along with the stashed state. -list:: +list [<options>]:: List the stashes that you currently have. Each 'stash' is listed with its name (e.g. `stash@\{0}` is the latest stash, `stash@\{1}` is @@ -55,6 +55,9 @@ list:: stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation stash@{1}: On master: 9cc0589... Add git-stash ---------------------------------------------------------------- ++ +The command takes options applicable to the linkgit:git-log[1] +command to control what is shown and how. show [<stash>]:: diff --git a/git-clone.sh b/git-clone.sh index b4e858c388..0d686c3a03 100755 --- a/git-clone.sh +++ b/git-clone.sh @@ -409,11 +409,12 @@ else cd "$D" || exit fi -if test -z "$bare" && test -f "$GIT_DIR/REMOTE_HEAD" +if test -z "$bare" then # a non-bare repository is always in separate-remote layout remote_top="refs/remotes/$origin" - head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` + head_sha1= + test ! -r "$GIT_DIR/REMOTE_HEAD" || head_sha1=`cat "$GIT_DIR/REMOTE_HEAD"` case "$head_sha1" in 'ref: refs/'*) # Uh-oh, the remote told us (http transport done against @@ -470,9 +471,16 @@ then git config branch."$head_points_at".merge "refs/heads/$head_points_at" ;; '') - # Source had detached HEAD pointing nowhere - git update-ref --no-deref HEAD "$head_sha1" && - rm -f "refs/remotes/$origin/HEAD" + if test -z "$head_sha1" + then + # Source had nonexistent ref in HEAD + echo >&2 "Warning: Remote HEAD refers to nonexistent ref, unable to checkout." + no_checkout=t + else + # Source had detached HEAD pointing nowhere + git update-ref --no-deref HEAD "$head_sha1" && + rm -f "refs/remotes/$origin/HEAD" + fi ;; esac diff --git a/git-send-email.perl b/git-send-email.perl index 59601e36e8..ccb87a2d55 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -475,7 +475,7 @@ if ($thread && !defined $initial_reply_to && $prompting) { $initial_reply_to = $_; } -if (defined $initial_reply_to && $_ ne "") { +if (defined $initial_reply_to) { $initial_reply_to =~ s/^\s*<?/</; $initial_reply_to =~ s/>?\s*$/>/; } diff --git a/t/t5701-clone-local.sh b/t/t5701-clone-local.sh index 822ac8c28e..59a165a6d4 100755 --- a/t/t5701-clone-local.sh +++ b/t/t5701-clone-local.sh @@ -63,4 +63,12 @@ test_expect_success 'Even without -l, local will make a hardlink' ' test 0 = $copied ' +test_expect_success 'local clone of repo with nonexistent ref in HEAD' ' + cd "$D" && + echo "ref: refs/heads/nonexistent" > a.git/HEAD && + git clone a d && + cd d && + git fetch && + test ! -e .git/refs/remotes/origin/HEAD' + test_done |