File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -744,29 +744,29 @@ function git::rev_parse_sha() {
744
744
git add file_1
745
745
git commit -qam ' commit_1'
746
746
SHA1=" $( git rev-parse HEAD) "
747
- SHORT1=" $( echo " $ SHA1" | sed ' s/........$// ' ) "
747
+ SHORT1=" ${ SHA1% ????????} "
748
748
749
749
# Another commit on branch 1 (at HEAD)
750
750
date > file_2
751
751
git add file_2
752
752
git commit -qam ' commit_2'
753
753
SHA2=" $( git rev-parse HEAD) "
754
- SHORT2=" $( echo " $ SHA2" | sed ' s/........$// ' ) "
754
+ SHORT2=" ${ SHA2% ????????} "
755
755
756
756
# A commit on branch 2 (not at HEAD)
757
757
git checkout -b branch_2
758
758
date > file_3
759
759
git add file_3
760
760
git commit -qam ' commit_3'
761
761
SHA3=" $( git rev-parse HEAD) "
762
- SHORT3=" $( echo " $ SHA3" | sed ' s/........$// ' ) "
762
+ SHORT3=" ${ SHA3% ????????} "
763
763
764
764
# Another commit on branch 2 (at HEAD)
765
765
date > file_4
766
766
git add file_4
767
767
git commit -qam ' commit_4'
768
768
SHA4=" $( git rev-parse HEAD) "
769
- SHORT4=" $( echo " $ SHA4" | sed ' s/........$// ' ) "
769
+ SHORT4=" ${ SHA4% ????????} "
770
770
771
771
assert_eq " $( git rev-parse " $SHA1 " ) " " $SHA1 "
772
772
assert_eq " $( git rev-parse " $SHA1 ^{commit}" ) " " $SHA1 "
You can’t perform that action at this time.
0 commit comments