Commit 9bf3acf
gitk: Parse arbitrary commit-ish in SHA1 field
We only accepted either SHA1s or heads/tags that have been read. This
meant the user could not, e.g., enter HEAD to go back to the current
commit.
This adds code to call out to git rev-parse --verify if all other
methods of interpreting the string the user entered fail.
(git-rev-parse alone is not enough as we really want a single
revision.)
The error paths change slighly, because we now know from the rev-parse
invocation whether the expression was valid at all. The previous
"unknown" path is now only triggered if the revision does exist, but
is not in the current view display.
Signed-off-by: Thomas Rast <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>1 parent 2b1fbf9 commit 9bf3acf
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7909 | 7909 | | |
7910 | 7910 | | |
7911 | 7911 | | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
7912 | 7917 | | |
7913 | 7918 | | |
7914 | 7919 | | |
| |||
7918 | 7923 | | |
7919 | 7924 | | |
7920 | 7925 | | |
7921 | | - | |
| 7926 | + | |
7922 | 7927 | | |
7923 | 7928 | | |
7924 | 7929 | | |
| |||
0 commit comments