author | Junio C Hamano <gitster@pobox.com> | |
Wed, 28 Jan 2009 23:00:27 +0000 (15:00 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 28 Jan 2009 23:00:27 +0000 (15:00 -0800) |
* tr/previous-branch:
t1505: remove debugging cruft
Simplify parsing branch switching events in reflog
Introduce for_each_recent_reflog_ent().
interpret_nth_last_branch(): plug small memleak
Fix reflog parsing for a malformed branch switching entry
Fix parsing of @{-1}@{1}
interpret_nth_last_branch(): avoid traversing the reflog twice
checkout: implement "-" abbreviation, add docs and tests
sha1_name: support @{-N} syntax in get_sha1()
sha1_name: tweak @{-N} lookup
checkout: implement "@{-N}" shortcut name for N-th last branch
Conflicts:
sha1_name.c
t1505: remove debugging cruft
Simplify parsing branch switching events in reflog
Introduce for_each_recent_reflog_ent().
interpret_nth_last_branch(): plug small memleak
Fix reflog parsing for a malformed branch switching entry
Fix parsing of @{-1}@{1}
interpret_nth_last_branch(): avoid traversing the reflog twice
checkout: implement "-" abbreviation, add docs and tests
sha1_name: support @{-N} syntax in get_sha1()
sha1_name: tweak @{-N} lookup
checkout: implement "@{-N}" shortcut name for N-th last branch
Conflicts:
sha1_name.c
1 | 2 | |||
---|---|---|---|---|
builtin-checkout.c | patch | | diff1 | | diff2 | | blob | history |
cache.h | patch | | diff1 | | diff2 | | blob | history |
sha1_name.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-checkout.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc sha1_name.c
index 722fc35a6d98e1c260c6e14738ad3b2d41d924aa,7d95bbb27ae7485525d89281fb79f8f1fbc3da51..5d0ac0263d04d7ec72a3b7dec4aaf47aec80da5e
--- 1/sha1_name.c
--- 2/sha1_name.c
+++ b/sha1_name.c
if (len == 40 && !get_sha1_hex(str, sha1))
return 0;
- /* basic@{time or number} format to query ref-log */
+ /* basic@{time or number or -number} format to query ref-log */
reflog_len = at = 0;
- if (str[len-1] == '}') {
+ if (len && str[len-1] == '}') {
- for (at = 0; at < len - 1; at++) {
+ for (at = len-2; at >= 0; at--) {
if (str[at] == '@' && str[at+1] == '{') {
reflog_len = (len-1) - (at+2);
len = at;